Edgewall Software

Opened 6 years ago

Last modified 5 years ago

#11542 closed enhancement

Deleting a resource should warn that attachments will also be deleted — at Version 9

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:

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.

Change History (10)

comment:1 by Peter Suter, 5 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 5 years ago by Peter Suter (previous) (diff)

in reply to:  1 ; comment:2 by Jun Omae, 5 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, 5 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, 5 years ago

Attachment: 20141213T105005.png added

comment:4 by Ryan J Ollos, 5 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, 5 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, 5 years ago

Milestone: next-stable-1.0.x1.1.3

comment:8 by Ryan J Ollos, 5 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:9 by Ryan J Ollos, 5 years ago

Release Notes: modified (diff)

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

Note: See TracTickets for help on using tickets.