Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Feb 2019 at 10:46 UTC
Updated:
24 Apr 2020 at 17:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
driverok commentedComment #3
driverok commentedComment #5
mandclu commentedAttaching a patch that moves the markup to templates within the file module (in both the core module and classy theme), calculated within the file module.
Comment #6
mandclu commentedProper patch attached this time.
Comment #7
lauriiiComment #8
lauriiiI removed changes made to Classy and added code for adding the
#suffixback in Stable so that theme extending Stable will remain unchanged.Comment #9
eli-tCoding standards nit - we should end // comment lines with a .
Where does this $file_entity come from? Should this be $file?
We should document the filesize variable in the docblock
Comment #10
lauriiiIt seems like #9.2 is caused by #3055474: template_preprocess_file_link will not work with a stdClass object, though it tries to.
Fixed all and renamed filesize to file_size.
Comment #11
eli-tReviewed the patch in #10 and confirm all concerns in #9 addressed. Have tested display of the file link in a custom theme with no base theme and the display is identical with and without this change so no regression in evidence. Also agree with the renaming of the filesize variable to file_size.
Therefore moving to RTBC.
Comment #12
lauriiiAdded credit for @Eli-T for a thorough review.
Comment #13
lauriii@alexpott recommended adding documentation to the Stable and Classy to point to the newly added Stable preprocess function. Keeping RTBC since this is a small documentation change.
I also tested this with Bootstrap since they use the same variable name to make sure that it works as expected. Everything seemed to work as usual.
Comment #14
alexpottWe need a change record for the additional of the theme variable and probably we could do with a release notes section to the issue summary.
Comment #15
lauriiiI created a change record for this.
I don't think we have to include this in the release notes given that this isn't disruptive change. This is also not a major or critical issue that we should highlight in the release notes.
Comment #16
alexpottCreating @Eli-T as per #12
Comment #17
alexpottCommitted cfd9934 and pushed to 8.8.x. Thanks!
Comment #20
marassa commentedI am confused: the committed patch actually ADDED some arbitrary markup generation into stable.theme that had never even been there, contrary to what was supposed to be done in the issue.
I had a preprocess_image_widget hook in my module that perfectly worked until I upgraded to 8.8. Took me hours to figure out why the output of my hook is ignored or overwritten, now it turns out that whatever I put in #suffix in my module will be overwritten by the theme...
Moving my hook to my theme won't work because I mostly need this functionality in admin/edit mode where I use Seven theme...