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 |
|---|---|---|---|
| #20 | 2377117-20.patch | 30.26 KB | pcambra |
| #18 | 2377117-18.patch | 30.2 KB | rpayanm |
Comments
Comment #1
mglamanPatch attached. I have a feeling this and #2377115: Replace all instances of entity_load('field_config') and entity_load_multiple('field_config') with static method calls might cause conflicts due to modifications of "use" declarations.
Comment #2
dstotijn commentedApplied patch, grepped for occurrences of "entity_load('field_storage_config'" and "entity_load_multiple('field_storage_config')"; none found. Reviewed the replacements with static method calls. Looks fine to me.
Comment #3
alexpottDue to #2377115: Replace all instances of entity_load('field_config') and entity_load_multiple('field_config') with static method calls this needs a reroll...
Comment #4
mglamanRerolled to fix conflicts.
Comment #5
mglamanForgot to remove tag, hide old patch.
Comment #6
tstoecklerSome minor comments. Feel free to correct those but marking RTBC anyway, because those are minor enough that they could be ignored IMO.
No biggie, but this empty line between the use statements should be removed.
Super minor, but if this to attain alphabetical ordering FieldStorageConfig should come after FieldConfig
Since we have to get the storage here anyway, this code could be made a bit nicer by avoiding the reliance on the static functions.
E.g. put a
at the top of the function (
$this->containeris preferred over\Drupalin tests)and then just use
and
below.
Comment #8
mglamanRerolled with suggestions from points 1 and 2. I think point 3 is valid, however it isn't universal (see resets done on field_config, other tests.)
Comment #11
swentel commentedComment #12
rpayanmComment #13
pcambraPatch applies cleanly and conversions look fine.
Comment #14
berdirMoving to the right component :)
Comment #18
rpayanmrerolled
Comment #19
alexpottNeeds a reroll.
Comment #20
pcambraComment #21
swentel commentedComment #22
alexpottCommitted 4d8bd96 and pushed to 8.0.x. Thanks!
beta evaluation is in the meta.