Closed Bug 1077172 Opened 10 years ago Closed 9 years ago

Allow attachments not linked inline

Categories

(developer.mozilla.org Graveyard :: File attachments, enhancement)

All
Other
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hoosteeno, Assigned: jezdez)

References

Details

(Whiteboard: [specification][type:feature])

What problems would this solve? =============================== Editors currently have to link to all attachments inline, even when such links don't make sense. If an editor forgets to link to an attachment at upload time, the upload will not be attached to the page. Who would use this? =================== Editors and some users (historical use is <1 percent, but more utility might increase this). What would users see? ===================== Links at the bottom of the page not included in the page's main content. What would users do? What would happen as a result? =================================================== Editors would have an easier file-upload experience and would have another publishing tool. Users would have easy access to files not linked inline. Is there anything else we should know? ======================================
As bug 866542 comment 20 points out, this feature implies a list of attachments visible to article viewers. Such a list exists today, but in bug 866542 we consider removing it from view pages only because it is not particularly valuable until this bug is fixed. If/when this bug is fixed, we'll need to add that list back to view pages if it was indeed removed.
Severity: normal → enhancement
I am uplifting discussion of this from bug 866542. In that bug, :wbamberg wrote: > I think there are 2 kinds of > "attachments": > > * resources used in the construction of the page, that are never intended > for download by users. For example all the screenshots in the Debugger page > are listed at the end: > https://developer.mozilla.org/en-US/docs/Tools/Debugger#Attachments. There's > no good reason to show this list on pages unless the page is being edited, > it's just noise. > > * resources actually intended for download by users. For example, the icons > in this section: > https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/ > Getting_started#Implementing_the_add-on. (For actual sample code I usually > link to a GitHub repo, (a) because I can't attach zips and (b) because it's > easier to keep it updated.) In these cases I'd want to link to the resource > in the article in context, but there is a case for wanting them available at > the end as well, so they are easily found by returning users, as you said up > in bug 866542 comment 17.
Component: General → File attachments
In the bug triage meeting, Jannis explained how attachments are linked to documents in the future. Needinfo'ing Jannis: Can you shed some light and to record what the way forward is?
Flags: needinfo?(jezdez)
The way forward is quite simple. There is already some app logic and data models to store the relation between a document and an attachment, but it's not used. Instead on every rendering of an article via kumascript and rendering of the edit page, kuma is scanning the article's HTML content with two regular expressions to find patterns that match the embedded URLs to the attachment serving view to find out the attachment IDs for a database query. That's insanely load intense compared to the amount of data we actually gleam from that parsing which could be saved during saving an article revision to the database. The way forward is to finish the existing code to make it so: a) when uploading a file to an article, that file is attached to the article and is listed in the file listing even when not embedded in the article's content b) the editor's attachment plugin will only offer the files originally uploaded to the article in the dropdown c) files that are attached to other articles can be embedded in an article by using the URL to the file That way we will get a manifest in the database of which files are embedded in which article and uploaded to which article originally. That's a key feature to be able to detect spam uploads and have a sensible maintenance option. As a migration we'll have to retroactively parse every article to populate the list of files that are linked in its HTML. Sadly we won't be able to figure out which article all the currently existing files were uploaded to originally. That means, for those legacy files, as soon as they are not embedded in an article anymore they won't show up in the list of files anymore for that article. Long term there is a chance to be able to fix some files manually via the admin. New files will know which article they were uploaded to originally though. File deletion will be facilitated via the Django admin UI for super users, similar to other features such as uploading new attachment revisions or making an older revision the "current" one. Deleting an attachment will offer a list of documents its attached to and remove both the attachment revisions (and the actual files related to those on the file system) as well as the entry in the document attachment list. This is work in progress.
Flags: needinfo?(jezdez)
Assignee: nobody → jezdez
Status: NEW → ASSIGNED
Commits pushed to master at https://github.com/mozilla/kuma https://github.com/mozilla/kuma/commit/362a6f97ebcd50266ddea43b3608ee9946b08fd7 Bug 1077172 - Improve managment command to fix historical attachments. This tries to guess better which document an attachment was originally uploaded to. If an attachment is included in multiple documents it: - favors documents with smaller primary keys (denoting earlier creation) - favors English documents as the orignal upload https://github.com/mozilla/kuma/commit/cd8bd703f31628261349d704bdab31616a53628b Merge pull request #3808 from mozilla/bug1077172 Bug 1077172 - Improve managment command to fix historical attachments.
When files are uploaded now, they are attached to the article they are uploaded to. So even if they are not referenced in the article's content anymore, they are still available in the edit view. Attachments that were uploaded so far needed to be ported to the new system by referencing a document, which worked by looking at which document they are referenced in. Earlier articles were prefered, as well as English articles, to determine the original article files were uploaded to. Some files were not able to be attached to in the onetime conversion. On stage those were: ID Title Modified 81 Firefoxlogo.png 2012-07-09T14:38:05 1095 Firefox-logo.png 2012-07-09T14:38:27 1103 Flower.jpg 2012-07-09T14:38:36 1322 xultu_toolbar1.png 2012-07-09T14:39:02 1325 xultu_toolbar4.png 2012-07-09T14:39:03 1338 Firefoxlogo.png 2012-07-09T14:39:04 1809 firefox-logo.png 2012-07-09T14:39:51 1851 Firefoxlogo.png 2012-07-09T14:39:55 1930 firefox-logo.png 2012-07-09T14:40:11 1932 Flower.jpg 2012-07-09T14:40:11 2032 Firefox-logo.png 2012-07-09T14:40:23 2035 Flower.jpg 2012-07-09T14:40:24 2127 Firefoxlogo.png 2012-07-09T14:40:34 2151 netscape-gecko-logo.jpg 2012-07-09T14:40:38 2319 hier05.gif 2012-07-09T14:40:52 2320 hier06.gif 2012-07-09T14:40:52 3030 download messages po.png 2012-07-09T14:42:53 3031 Verbatim Welcome Page .png 2012-07-09T14:42:53 3032 has suggestions.png 2012-07-09T14:42:53 3033 accept suggestions.png 2012-07-09T14:42:53 3034 Commit to VCS.png 2012-07-09T14:42:54 3051 mozilla_logo.png 2012-07-09T14:42:57 3052 logo-add-ons-half.png 2012-07-09T14:42:57 3053 maemo-image.png 2012-07-09T14:42:57 3054 fx.png 2012-07-09T14:42:57 3576 beer-sign-in.png 2012-07-09T14:44:33 3578 browserid-check-your-email.png 2012-07-09T14:44:34 3580 browserid-last-step.png 2012-07-09T14:44:34 3581 browserid-sign-in-with-password.png 2012-07-09T14:44:34 3582 browserid-verify-email.png 2012-07-09T14:44:34 3583 browserid-enter-email.png 2012-07-09T14:44:35 3584 browserid-sign-in-no-password.png 2012-07-09T14:44:35 Prod list forthcoming.
Prod list: ID Title Modified 81 Firefoxlogo.png 2012-07-09T14:38:05 1095 Firefox-logo.png 2012-07-09T14:38:27 1103 Flower.jpg 2012-07-09T14:38:36 1322 xultu_toolbar1.png 2012-07-09T14:39:02 1325 xultu_toolbar4.png 2012-07-09T14:39:03 1338 Firefoxlogo.png 2012-07-09T14:39:04 1809 firefox-logo.png 2012-07-09T14:39:51 1851 Firefoxlogo.png 2012-07-09T14:39:55 1930 firefox-logo.png 2012-07-09T14:40:11 1932 Flower.jpg 2012-07-09T14:40:11 2032 Firefox-logo.png 2012-07-09T14:40:23 2035 Flower.jpg 2012-07-09T14:40:24 2127 Firefoxlogo.png 2012-07-09T14:40:34 2151 netscape-gecko-logo.jpg 2012-07-09T14:40:38 2160 traduccion-pendiente-small.png 2012-07-09T14:40:39 2313 Help-browser_002.png 2012-07-09T14:40:52 2319 hier05.gif 2012-07-09T14:40:52 2320 hier06.gif 2012-07-09T14:40:52 2476 moztwforum.png 2012-07-09T14:41:04 3030 download messages po.png 2012-07-09T14:42:53 3031 Verbatim Welcome Page .png 2012-07-09T14:42:53 3032 has suggestions.png 2012-07-09T14:42:53 3033 accept suggestions.png 2012-07-09T14:42:53 3034 Commit to VCS.png 2012-07-09T14:42:54 3051 mozilla_logo.png 2012-07-09T14:42:57 3052 logo-add-ons-half.png 2012-07-09T14:42:57 3053 maemo-image.png 2012-07-09T14:42:57 3054 fx.png 2012-07-09T14:42:57 3526 manage a locale.png 2012-07-09T14:44:24 3527 Import.png 2012-07-09T14:44:24 3528 Texts.png 2012-07-09T14:44:24 3529 Manage Search Engines.png 2012-07-09T14:44:24 3530 approved translation.png 2012-07-09T14:44:24 3531 export.png 2012-07-09T14:44:24 3576 beer-sign-in.png 2012-07-09T14:44:33 3578 browserid-check-your-email.png 2012-07-09T14:44:34 3580 browserid-last-step.png 2012-07-09T14:44:34 3581 browserid-sign-in-with-password.png 2012-07-09T14:44:34 3582 browserid-verify-email.png 2012-07-09T14:44:34 3583 browserid-enter-email.png 2012-07-09T14:44:35 3584 browserid-sign-in-no-password.png 2012-07-09T14:44:35 3672 Import_2.png 2012-07-09T14:44:47 3673 export_2.png 2012-07-09T14:44:47 5653 Image of location finder app 2013-07-24T06:19:09 5655 Facebook desktop 2013-07-24T06:47:01 5657 Facebook mobile 2013-07-24T06:47:33 6291 Front of the user guide card 2013-10-15T15:36:29 6293 Back of the user guide card 2013-10-15T15:40:06 6829 Firefox OS Boilerplate in French 2014-01-27T09:19:20 6833 Transifex create 2014-01-27T09:22:07 9811 debugger-script-filter 2015-01-09T15:52:28 10095 Videos 2015-02-07T18:17:23 10713 Selection mask logic 2015-05-05T05:28:39
Closing as this is now in production.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.