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.
Comment | File | Size | Author |
---|---|---|---|
#9 | file_display-2090619-9.patch | 6.44 KB | yched |
#3 | file_display-2090619-2.patch | 6.41 KB | smiletrl |
#3 | interdiff-1-2.txt | 656 bytes | smiletrl |
#1 | file_display-2090619-1.patch | 6.41 KB | yched |
Comments
Comment #1
yched CreditAttribution: yched commentedPatch
Comment #1.0
yched CreditAttribution: yched commentedexisting change record
Comment #1.1
yched CreditAttribution: yched commentedadd parent issue
Comment #3
smiletrl CreditAttribution: smiletrl commentedThis should probably be fine.
Comment #4
yched CreditAttribution: yched commented/me slaps himself in the face
Thanks @smiletrl :-)
Comment #5
smiletrl CreditAttribution: smiletrl commentedLOL..
Comment #6
sandipmkhairnar CreditAttribution: sandipmkhairnar commentedThanks @smiletrl and @yched for patch.
I have apply and review the patch its working fine for me.
Comment #7
smiletrl CreditAttribution: smiletrl commented#3: file_display-2090619-2.patch queued for re-testing.
Comment #8
smiletrl CreditAttribution: smiletrl commentedThis is probably ready to go...
Comment #9
yched CreditAttribution: yched commentedReroll just in case.
Comment #10
webchickNice clean-up.
Committed and pushed to 8.x. Thanks!
Comment #11.0
(not verified) CreditAttribution: commentedFileItem