Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This patch makes the style name appear as a class when rendering an image. Very useful for CSS theming. Applies cleanly to Drupal 7 too.
Comments
Comment #2
RobLoachAdding in the class attributes help?
Comment #4
eojthebraveOoh. I like this.
Comment #5
andypostThis require a tests to ensure that class injected
Comment #6
tim.plunkettPostponing on #1696416: Regression: theme_image_style() is broken.
I'll work on this once that's in.
Comment #7
tim.plunkettWell, went ahead and rolled it anyway. Assumes the other issue was committed.
Comment #8
tim.plunkettRerolled since that went in.
Comment #10
tim.plunkettHad to add the class to output in a couple other places.
Comment #12
tim.plunkettMissed one more.
Comment #13
RobLoachThanks Tim!
Comment #14
Dries CreditAttribution: Dries commentedAny reason we prefix the style name (with 'image-style-')? Just wondering as it seems a bit redundant to me.
Comment #15
RobLoachWe prefix the style name with
image-style-
so that it doesn't conflict with any other class names. If you had an image style named "item-list", for example, it would conflict with the .item-list class that we use in listed items.Comment #16
tim.plunkettThe changes to other tests that don't even care about this class are not ideal. Postponing this on #1706878: Add WebTestBase::assertThemeOutput() to allow modules to test theme function output
Comment #17
tim.plunkettNevermind, this seems a necessary evil.
Comment #18
catch#12: drupal-1175764-12.patch queued for re-testing.
Comment #20
tim.plunkettRerolled due to #1446464: Get rid of file_field_load() - shouldn't load all file object data with field load - only file ID
Comment #21
tim.plunkettRerolled after #1742958: All spellings of URI should be uppercase
Comment #22
moshe weitzman CreditAttribution: moshe weitzman commentedno brainer
Comment #23
Dries ArnoldsWill this be comitted to D7 as well? Or just D8?
Comment #24
tim.plunkett@Pixelstyle it's tagged for backport, but that decision lies with the branch maintainer. Either way, it has to go into D8 first.
Comment #25
webchickSeems like a nice improvement, and we are currently under thresholds.
Committed and pushed to 8.x.
Since this is only adding a new class, and not changing any existing ones, I think backporting it is probably kosher (subject to overruling by David_Rothstein, of course).
Comment #26
tim.plunkettI don't have time to reroll this myself, but it wouldn't be too hard.
Comment #27
danillonunes CreditAttribution: danillonunes commentedI don't know if I ported all the tests correctly, let's look at what the bot says.
Comment #29
danillonunes CreditAttribution: danillonunes commentedLet's try again.
Comment #30
danillonunes CreditAttribution: danillonunes commentedComment #31
lukusJust tried to apply this and received the error:
Does it need to be re-rolled for the latest version of 7.x ?
Comment #32
tim.plunkett#29: 0001-Issue-1175764-by-tim.plunkett-Rob-Loach-eojthebrave-.patch queued for re-testing.
Comment #34
danillonunes CreditAttribution: danillonunes commentedThe patch does apply to latest 7.x branch using git am. I think there are some image tests added later that are failing. Let's try this.