Closed
Bug 1026639
Opened 11 years ago
Closed 9 years ago
Provide a way to delete file attachments
Categories
(developer.mozilla.org Graveyard :: File attachments, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jbennett, Assigned: jezdez)
References
Details
(Whiteboard: [LOE?])
Currently there is no way to delete attachments. See also bug 779541, which requested auto-deletion when the page is deleted (but was rejected since the same file may be used on other pages).
Comment 1•10 years ago
|
||
:groovecoder, can you estimate effort on this?
Flags: needinfo?(lcrouch)
Whiteboard: [LOE?]
Reporter | ||
Comment 3•10 years ago
|
||
The main thing holding this up is a spec of how it's supposed to behave. In the past this request was to emulate MindTouch behavior, where a single file was tied to a single document, would need to be re-uploaded to be used in another document, and deletion of the document would delete all associated files.
I would like to think we no longer need to emulate the MindTouch workflow, but I can't say that for certain. So we'd need some sort of description of expected behavior from the folks who'd be using the deletion feature.
Flags: needinfo?(jbennett)
Comment 4•9 years ago
|
||
For attachments that are only used by a single page, there is no problem.
In case an attachment is used by multiple pages, I see three solutions:
1. Forbid deletion
As long as there are several references to an attachment, there's no way to delete it. Authors first need to edit the articles to remove the references before they can delete the attachment.
2. Allow deletion but give a warning
Let the user delete the attachment, though give him a list of pages, which still reference it and tell him to remove the references.
3. Allow deletion without warning
Let the user delete the attachment without a hint about the referencing pages.
I'd exclude the third solution, because it breaks pages without warning. For the first two solutions it depends on whether the user should be forced to update the related pages.
One question is also whether to offer a page listing all attachments like MediaWiki is doing it (see e.g. the Firebug wiki.[1]) or whether to allow their deletion only from within the referencing pages.
Sebastian
[1] https://getfirebug.com/wiki/index.php/Special:UnusedFiles
Comment 5•9 years ago
|
||
Note that any admin can delete attachments. So pinging one of them is a work around for now (not very discoverable though)
Updated•9 years ago
|
Blocks: mdn-attachments
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jezdez
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•9 years ago
|
||
This is in https://github.com/mozilla/kuma/pull/3769 now
Comment 7•9 years ago
|
||
Commits pushed to master at https://github.com/mozilla/kuma
https://github.com/mozilla/kuma/commit/25ae0e1c20cbb7be7b3c81da90ac1cff3f276e68
Fix bug 1026639 - Allow deleting attachments.
This moves attachment revision files into a trash.
There is a management command to purge the trash after a number of days that should be run regularly via cron.
This again extends the attachments admin UI somewhat to support this new feature.
It's not offered to the front-end users at all.
https://github.com/mozilla/kuma/commit/874e831f27af44620d9a8a82bc9287153e5f4884
Bug 1026639 - Refactored and expanded attachment tests.
https://github.com/mozilla/kuma/commit/5042d2972872a0a6b046317681168f913b3aa452
Bug 1026639 - Allow fetching missing attachments from main site during development.
https://github.com/mozilla/kuma/commit/341c85da942e2b82daabd4649f82bf2cc484ca08
Bug 1026639 - Improve attachment deletion.
- raise exception when deleting last revision of attachment via ORM call
- prevent deleting last revision in admin by disabling the delete option
- after deleting a revision make previous attachment revision the current one
- disable admin delete action since they eluded modification
https://github.com/mozilla/kuma/commit/40a8ce5833ece3774798d61c353848a0eea68c30
Bug 1026639 - Catch OS error when trying to find filesize for non-existing file.
https://github.com/mozilla/kuma/commit/d72856aec1ea3635f66f174184640ea9b43dbcd0
Bug 1026639 - Further improve the deletion workflow.
This makes the deletion only block deleting an attachment revision if the deletion doesn't originate on the attachment admin as that would indicate the deletion of all revisions in the first place.
https://github.com/mozilla/kuma/commit/313d69a1c6d640f5359f962205f5ee96e006a16e
Bug 1026639 - Add migration for the on_delete change in the Attachment model.
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment 8•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/kuma
https://github.com/mozilla/kuma/commit/e872ec3026a543a0b5e911a7339a9c1c9e352552
bug 1026639 - Anonymize DeletedAttachments table
This table was omitted from databases created with clone_db
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•