Edgewall Software
Modify

Opened 5 years ago

Closed 4 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:
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:

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 4 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 years ago by Peter Suter

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 4 years ago by Peter Suter (previous) (diff)

comment:2 in reply to:  1 ; Changed 4 years ago by Jun Omae

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.

comment:3 in reply to:  2 Changed 4 years ago by Peter Suter

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.

Changed 4 years ago by Ryan J Ollos

Attachment: 20141213T105005.png added

comment:4 Changed 4 years ago by Ryan J Ollos

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 Changed 4 years ago by Peter Suter

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

comment:6 Changed 4 years ago by Ryan J Ollos

comment:7 Changed 4 years ago by Ryan J Ollos

Milestone: next-stable-1.0.x1.1.3

comment:8 Changed 4 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newassigned

comment:9 Changed 4 years ago by Ryan J Ollos

Release Notes: modified (diff)

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

comment:10 Changed 4 years ago by Ryan J Ollos

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

comment:11 Changed 4 years ago by Ryan J Ollos

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 Changed 4 years ago by Ryan J Ollos

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.
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.