Part of meta-issue #2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method calls
See the detailed explanations and examples there.
| Comment | File | Size | Author |
|---|---|---|---|
| #53 | interdiff.txt | 1.1 KB | linl |
| #53 | replace_all_instances-2321901-53.patch | 16.6 KB | linl |
| #48 | replace_all_instances-2321901-48.patch | 17.42 KB | linl |
| #45 | replace_all_instances-2321901-45.patch | 17.41 KB | siva_epari |
| #45 | interdiff-42-45.txt | 683 bytes | siva_epari |
Comments
Comment #1
temoor commentedComment #2
m1r1k commentedComment #3
Michael Hodge Jr commentedI applied the patch, grepped the code and can confirm things look as they should.
Comment #4
alexpottNeeds to have the storage injected instead.
Also as this is changing the responsive_image module I'd like this postponed on #2271529: Move breakpoint settings to theme and module *.breakpoints.yml files at root level
Comment #5
temoor commentedRerolled patch and injected storage.
Comment #10
pcambraHere's a re-roll adding a couple of loads that have came in since #5
Comment #12
berdirMoving this to the right component :)
Comment #13
unstatu commentedMade a reroll.
Something strange is happening with the tests. Drupal\\image\\Tests\\ImageAdminStylesTest::testStyle is failing even if no code is changed in a 8.0.x installation.
Comment #14
unstatu commentedComment #15
David Hernández commentedUpdated tag to the correct one.
Comment #16
unstatu commentedComment #18
unstatu commentedComment #20
unstatu commentedStored the injected EntityStorage into the class attribute.
Comment #21
linl commentedPatch no longer applies, tagging for reroll.
Comment #22
piyuesh23 commentedRe-rolled the patch.
Comment #23
pwieck commentedComment #24
jeroentCreated re-roll.
Comment #26
jeroentThis is the right patch...
Comment #27
jeroent.
Comment #29
jeroentThis should fix the tests.
Comment #30
linl commentedComment #31
pcambraComment #32
lokapujyaRerolled. Conflict with ResponsiveImageFormatter use statements.
Comment #33
lokapujyaMight not be needed anymore, but I can't be sure and it's out of scope of this issue.
Comment #34
jeroentPatch no longer applies.
Comment #35
lokapujyaPatch submitted by the Drush iq-submit command.
Comment #36
lokapujyaRerolled.
Comment #37
lokapujyaComment #39
andypostdefine the class variable
need blank line between
should be full namespaced like second one
Comment #40
siva_epari commentedPatch rerolled and included changes suggested by andypost.
Comment #41
mile23Patch applied, and I couldn't find any instances of image_style_load() or entity_load('image_style") or their _multiple()s.
I made entity_load() and it's multiple pal throw exceptions if entity type was 'image_style' and ran unit tests. Not conclusive due to the question of coverage, but there you go.
Couldn't find out-of-scope changes.
The changes from #39 are in the interdiff but not the patch. Maybe hit the wrong commit or something?
Comment #42
siva_epari commentedSorry. Patch in #40 was just a reroll. Added suggested changes now.
Comment #43
siva_epari commentedComment #44
mile23Needs /** instead of /*
Thanks. :-)
Comment #45
siva_epari commentedOops. Wonder, how that crept in :P
Fixed!
Comment #46
mile23Adds container create/construct pattern to ImageFormatter and ResponsiveImageFormatter.
I couldn't find any instances of image_style_load(), entity_load('entity_style'), or entity_load_multiple('entity_style').
Comment #48
linl commentedReroll following #2457887: Use Utility\SafeMarkup class instead of Utility\String for placeholder(), checkPlain(),format() functions
Comment #49
jeroentRTBC as per #46
Comment #50
jeroentComment #51
xjmThanks @LinL and @JeroenT.
entity_load()andentity_load_multiple()are not marked as deprecated, and there is no such thing asimage_style_load()as far as I can see? So this is not consistent with what's in the parent issue's beta evaluation: #2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method calls Edit: I've posted a comment there.Comment #52
alexpottNot used.
This does not look like it is needed. The $large_style variable is populated already.
Comment #53
linl commentedNew patch with changes from #52.
Comment #54
linl commentedAlso updating issue title - image_style_load() was removed in #2190313: Add $EntityType::load() and loadMultiple() to simplify loading entities.
Thanks @xjm.
Comment #55
mile23Removes all instances of entity_load('image_style') and entity_load_multiple('image_style'), addresses issues in #52.
Whether this is a prioritized change is up to the maintainer... I think it's better to be consistent with the OOP approach before release, and the work is already done anyway.
Comment #56
alexpottCan we get a followup to replace the use of
entity_load_unchanged()in ImageAdminStylesTest?As stated in #2225347-29: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method calls i think that replacing calls to entity_load() etc are fine atm. Committed 1f9399f and pushed to 8.0.x. Thanks!
Comment #58
jeroentCreated followup issue: #2471593: Replace the use of entity_load_unchanged() in ImageAdminStylesTest.