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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Status: Active » Needs review
Issue tags: +API change
FileSize
6.41 KB

Patch

yched’s picture

Issue summary: View changes

existing change record

yched’s picture

Issue summary: View changes

add parent issue

Status: Needs review » Needs work

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

smiletrl’s picture

Status: Needs work » Needs review
FileSize
656 bytes
6.41 KB

This should probably be fine.

yched’s picture

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

smiletrl’s picture

LOL..

sandipmkhairnar’s picture

Thanks @smiletrl and @yched for patch.

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

smiletrl’s picture

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

smiletrl’s picture

Status: Needs review » Reviewed & tested by the community

This is probably ready to go...

yched’s picture

Reroll just in case.

webchick’s picture

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.

Anonymous’s picture

Issue summary: View changes

FileItem