Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The workflow of attaching files on issues changed significantly. It won't be obvious for users that one needs to click 'Edit' on issue node to be able to upload new file/patch.
Proposed resolution
Add 'Upload a file' button to the table of attachments, which will open node edit form and scroll to the place where you attach files.
Remaining tasks
User interface changes
Green button!
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#6 | 1972686-6.upload-link.patch | 5.93 KB | dww |
Comments
Comment #1
dwwAs discussed in IRC, this should be a setting on the field display formatter that. Then, the formatter renders this button if you want it.
Note that we can't assume the file field in question is attached to a node -- we need to use the proper Entity API (such as it is) to make sure this would keep working even if it was used on a file field attached to a user or any other kind of entity.
Finally, since this is specifically to help D7 project_issue, retagging.
Thanks!
-Derek
Comment #2
dwwComment #3
dwwWhat should happen if there are no files attached? Currently, we don't render a table at all -- the field formatter simply produces no output whatsoever. If this setting is selected, do we always want the link, even if there's no other output? Is that going to be weird?
Thanks,
-Derek
Comment #4
tvn CreditAttribution: tvn commentedI think we want the link always. First person to upload a file needs to be able to figure out how to do it.
Comment #5
klonosAre we still going for the mockup in the issue summary of #1545922: [META] Issue page redesign? If so, then perhaps a permanent "Add file" button along the two ones we already have ("Update issue" the "Add comment")?
Alternatively, we could have the "Update issue" button have a "or add file" sub-title (as part of the button).
Comment #6
dwwThe D7 core entity API sucks in various ways that make this ugly. See @todo comments in here. :/ But, this is working (at least for a few key entity types -- node, user, taxonomy_term and comment for now).
I'd love feedback from tvn as to whether the theme function in here is going to work for our needs (e.g. adding action-button class or whatever we do on d.o to get the big green buttons).
Thanks,
-Derek
Comment #7
dwwPushed a slightly different patch:
http://drupalcode.org/project/extended_file_field.git/commit/18e4ab5
- Moved the t() logic outside of the theme function
- Added an 'action-button' class to
<a>
at tvn's request- Fixed the PHPDoc for the new theme function
Comment #8
tvn CreditAttribution: tvn commentedPlease change the class name to 'upload-button', otherwise looks good. Thanks!
Comment #9
dwwDone:
http://drupalcode.org/project/extended_file_field.git/commit/60820c4
Also pushed a drupalorg_project_update_N() that configures this for us:
http://drupalcode.org/project/drupalorg.git/commit/0280342