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.
EntityManager has been split into 11 classes (more info). So now EntityManager and EntityManagerInterface are deprecated.
Comment | File | Size | Author |
---|---|---|---|
#11 | deprecated_entity_manager-2856238-11.patch | 1.62 KB | subson |
| |||
#6 | deprecated_entity_manager-2856238-6.patch | 1.38 KB | Munavijayalakshmi |
| |||
#4 | deprecated_entity_manager-2856238-4.patch | 4.9 KB | Munavijayalakshmi |
#2 | deprecated_entity_manager-2856238-2.patch | 23.07 KB | Munavijayalakshmi |
Comments
Comment #2
Munavijayalakshmi CreditAttribution: Munavijayalakshmi at Valuebound commentedComment #4
Munavijayalakshmi CreditAttribution: Munavijayalakshmi at Valuebound commentedComment #6
Munavijayalakshmi CreditAttribution: Munavijayalakshmi at Valuebound commentedComment #7
Berdirboth examples use an entity query, lets also combine converting the usage of this to use $storage->getQuery().
We could also properly inject the dependency.
Comment #8
Munavijayalakshmi CreditAttribution: Munavijayalakshmi at Valuebound commentedComment #9
jonathanshawClosed #2755047: Replace the entity manager with the entity type manager in the code base. as duplicate
Comment #10
jonathanshawComment #11
subson CreditAttribution: subson as a volunteer commentedRe-rolling the patch as suggested by Berdir in #7 to use $storage->getQuery().
I tried to pass entityTypeManager as dependency in the PrepareUninstallForm.php, but getting this error -
"Error: Using $this when not in object context in ... " I guess because deleteSubscribers and removeFields is running as a batch process.
Let me know if there is a way to pass dependency in a batch process without using \Drupal::entityTypeManager().
Comment #13
BerdirThanks.
Agreed, these are static methods, we can't inject there.