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!

#1545922: [META] Issue page redesign

CommentFileSizeAuthor
#6 1972686-6.upload-link.patch5.93 KBdww
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Title: Link to node edit form on table of attachments » Link to entity edit form on table of attachments
Issue tags: -porting +project

As 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

dww’s picture

Assigned: Unassigned » dww
dww’s picture

What 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

tvn’s picture

I think we want the link always. First person to upload a file needs to be able to figure out how to do it.

klonos’s picture

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

dww’s picture

Status: Active » Needs review
FileSize
5.93 KB

The 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

dww’s picture

Status: Needs review » Fixed

Pushed 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

tvn’s picture

Status: Fixed » Needs work

Please change the class name to 'upload-button', otherwise looks good. Thanks!

dww’s picture

Status: Needs work » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 18e4ab5 on 7.x-1.x, empty-file-2150029 by dww:
    [#1972686] by dww: Added a setting for an action link to upload files.
    
  • Commit 60820c4 on 7.x-1.x, empty-file-2150029 by dww:
    [#1972686]: Follow-up to change the class to "upload-button".