Edgewall Software
Modify

Opened 10 years ago

Closed 9 years ago

#11542 closed enhancement (fixed)

Deleting a resource should warn that attachments will also be deleted

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.3
Component: general Version: 1.0-stable
Severity: normal Keywords: attachment
Cc: Branch:
Release Notes:

List of attachments is shown on the wiki, ticket and milestone delete pages, along with a warning that the attachments will be deleted if the resource is deleted.

API Changes:
Internal Changes:

Description

Specifically, when deleting a wiki page, the wiki delete page should list the attachments that will be deleted and warn that the files are not recoverable after the parent resource is deleted.

The same behavior should probably also be applied to the Milestone and Ticket resources.

Attachments (1)

20141213T105005.png (33.4 KB ) - added by Ryan J Ollos 9 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Peter Suter, 10 years ago

Keywords: attachment added

Deleting a milestone does actually not seem to delete the attachments so far. (Is this a defect? Perhaps this should be changed in a separate ticket first.)

  • trac/ticket/model.py

    diff -r 19ce84254a0a trac/ticket/model.py
    a b  
    10111011        with self.env.db_transaction as db:
    10121012            self.env.log.info("Deleting milestone %s", self.name)
    10131013            db("DELETE FROM milestone WHERE name=%s", (self.name,))
     1014            Attachment.delete_all(self.env, self.realm, self.name)
    10141015            # Don't translate ticket comment (comment:40:ticket:5658)
    10151016            self.move_tickets(retarget_to, author, "Milestone deleted")
    10161017            self._old['name'] = None
Last edited 10 years ago by Peter Suter (previous) (diff)

in reply to:  1 ; comment:2 by Jun Omae, 10 years ago

Replying to psuter:

Deleting a milestone does actually not seem to delete the attachments so far. (Is this a defect? Perhaps this should be changed in a separate ticket first.)

Oh, that's so bad. Trac 0.12.5 has the issue. We should fix it on 0.12-stable. Please create a new ticket.

in reply to:  2 comment:3 by Peter Suter, 10 years ago

Replying to jomae:

Oh, that's so bad. Trac 0.12.5 has the issue. We should fix it on 0.12-stable. Please create a new ticket.

OK, thanks for confirming. I created #11672.

by Ryan J Ollos, 9 years ago

Attachment: 20141213T105005.png added

comment:4 by Ryan J Ollos, 9 years ago

I didn't use list_of_attachments.html because it seems better to present just a simple list of attachments without extra data to clutter the presentation.

If the changes look good to others I will make similar changes to:

Proposed changes in log:rjollos.git:t11542.

comment:5 by Peter Suter, 9 years ago

Note that deleting a single version might also delete the attachments (if it is the only version).

comment:7 by Ryan J Ollos, 9 years ago

Milestone: next-stable-1.0.x1.1.3

comment:8 by Ryan J Ollos, 9 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:9 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)

Refactoring of the wiki_delete.html and list_of_attachments.html templates committed in [13533].

comment:10 by Ryan J Ollos, 9 years ago

Revised changes from comment:6 committed to trunk in [13555:13556]. New extraction in [13557].

comment:11 by Ryan J Ollos, 9 years ago

Proposed changes in log:rjollos.git:t11542-delete-attachments-notice.1. Notices have been added to the Milestone and Ticket delete pages, and some HTML validation errors fixed on the Wiki delete page.

comment:12 by Ryan J Ollos, 9 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in [13601:13602].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.