Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Parent Issue
#2359437: [meta] Remove entity_load* family of functions usage from the code base
Problem/Motivation
There are cases where entities of the editor entity type are retrieved using the functional loader, entity_load*()
Proposed resolution
Replace calls to entity_load*('editor', ...)
with Editor::load*()
Comment | File | Size | Author |
---|---|---|---|
#11 | interdiff.txt | 632 bytes | snehi |
#11 | 2723587-10.patch | 8.71 KB | snehi |
#7 | interdiff-2723587-4-7.txt | 8.04 KB | marvin_B8 |
#7 | 2723587-7.patch | 8.1 KB | marvin_B8 |
Comments
Comment #2
valthebaldSee #2359437: [meta] Remove entity_load* family of functions usage from the code base
Comment #3
Beau Townsend CreditAttribution: Beau Townsend commentedWorking on removing & replacing instances of deprecated entity_load* 'editor' functions.
Comment #4
Beau Townsend CreditAttribution: Beau Townsend as a volunteer commentedPatch for above issue.
Comment #5
valthebaldFor entity_load('editor') in tests, please use Editor::load() - it's shorter, and usage of global \Drupal object in tests is discourageed
Comment #7
marvin_B8 CreditAttribution: marvin_B8 as a volunteer and at comm-press commentedComment #8
John Cook CreditAttribution: John Cook commentedAfter applying the patch there is still one more use of functional loading:
Editor::loadMultiple()
can be used to retrieve multiple entities.Comment #9
John Cook CreditAttribution: John Cook commentedUpdated summary.
Comment #10
marvin_B8 CreditAttribution: marvin_B8 as a volunteer and at comm-press commentedComment #11
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedDone.
Comment #12
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedSame timing for Patch coincidence :)
Comment #15
John Cook CreditAttribution: John Cook commentedThe patches in comments #10 and #11 contain the same changes.
After applying patch #11 there were no more calls to entity_load*() for the editor entity type.
Comment #17
John Cook CreditAttribution: John Cook commentedThe testbot has passed #11, so setting back to RTBC.
Comment #18
catchComment #20
Wim LeersThank you!