Followup for #2020677: file_field_prepare_view() should not delete items:
File field items need some logic to determine whether they should be displayed when rendering the field values.

- This logic is currently centralized in an isDisplayed($item) helper method in the FileFormatterBase class.
It is however inherent to the $item and not to the formatter, so this method would be better off on the $item directly.
We can do this now that #2015697: Convert field type to typed data plugin for file and image modules has landed and we have a FileItem class.
- It is not used consistently throughout all file formatters (some still directly check the value of $item->display, which is not strictly equivalent)

Change record https://drupal.org/node/2047939 will need to be updated if this goes in.

Files: 
CommentFileSizeAuthor
#9 file_display-2090619-9.patch6.44 KByched
PASSED: [[SimpleTest]]: [MySQL] 59,278 pass(es).
[ View ]
#3 file_display-2090619-2.patch6.41 KBsmiletrl
PASSED: [[SimpleTest]]: [MySQL] 58,624 pass(es).
[ View ]
#3 interdiff-1-2.txt656 bytessmiletrl
#1 file_display-2090619-1.patch6.41 KByched
FAILED: [[SimpleTest]]: [MySQL] 59,132 pass(es), 4 fail(s), and 0 exception(s).
[ View ]

Comments

Status:Active» Needs review
Issue tags:+API change
StatusFileSize
new6.41 KB
FAILED: [[SimpleTest]]: [MySQL] 59,132 pass(es), 4 fail(s), and 0 exception(s).
[ View ]

Patch

Issue summary:View changes

existing change record

Issue summary:View changes

add parent issue

Status:Needs review» Needs work

The last submitted patch, file_display-2090619-1.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new656 bytes
new6.41 KB
PASSED: [[SimpleTest]]: [MySQL] 58,624 pass(es).
[ View ]

This should probably be fine.

/me slaps himself in the face
Thanks @smiletrl :-)

LOL..

Thanks @smiletrl and @yched for patch.

I have apply and review the patch its working fine for me.

#3: file_display-2090619-2.patch queued for re-testing.

Status:Needs review» Reviewed & tested by the community

This is probably ready to go...

StatusFileSize
new6.44 KB
PASSED: [[SimpleTest]]: [MySQL] 59,278 pass(es).
[ View ]

Reroll just in case.

Status:Reviewed & tested by the community» Fixed

Nice clean-up.

Committed and pushed to 8.x. Thanks!

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

Issue summary:View changes

FileItem