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.
\Drupal::entityManager() is deprecated and should be using \Drupal::entityTypeManager() according to: https://api.drupal.org/api/drupal/core%21lib%21Drupal.php/function/Drupa...
Comment | File | Size | Author |
---|---|---|---|
#22 | interdiff-19-22.txt | 1.25 KB | TR |
#22 | 2908271-22.patch | 11.36 KB | TR |
Comments
Comment #2
BramDriesenComment #3
BramDriesenComment #5
swati.nuna CreditAttribution: swati.nuna as a volunteer and at InfoBeans Technologies Limited commentedhi,
I have added the updated patch file.
Here in the EntityReferenceItem.php file I have found 11 occurrences of entityManager() which i updated.
Please review.
Comment #7
swati.nuna CreditAttribution: swati.nuna as a volunteer and at InfoBeans Technologies Limited commentedHere is new updated patch file.
Please review.
Comment #9
swati.nuna CreditAttribution: swati.nuna as a volunteer and at InfoBeans Technologies Limited commentedHere is a new patch file.
Hope it will work.
Comment #10
jofitz CreditAttribution: jofitz at ComputerMinds commentedCorrected coding standards error: removed unused
use
statement.Comment #11
BramDriesen@Jo Fitzgerald Looks good, but what about the entityManager I replaced in my initial patch (that failed)? :)
Comment #12
jofitz CreditAttribution: jofitz at ComputerMinds commentedPut back the changes from the patch in #2 that were inexplicably excluded from the patch in #9 (and #10).
Comment #13
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer commentedWhy then not to replace all other calls to entityManager() method? Here is the patch #12 re-roll with replacing all other calls with appropriate services.
Comment #15
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer commentedRe-rolled patch with correct line endings.
Comment #16
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer commentedComment #17
Mile23Let's consistently call these $entity_type_manager
Resolve the service outside the foreach() loops.
I didn't look very closely at this test, but if we're truly deprecating entity.manager out of the code then we should not mock it in the test. I'm not sure if this test is specific enough one way or another, but if we can remove the entity.manager mock, then we should.
Comment #18
Mile23Comment #19
jofitz CreditAttribution: jofitz at ComputerMinds commentedAddressed the test failures by mocking the entity_field.manager service.
Removed Novice tag because this is quite complicated.
Comment #22
TR CreditAttribution: TR commentedRe-rolled patch against 8.8.x.
Mostly just offsets, but I had to remove one hunk from the patch and change another because those lines were already fixed by out-of-scope changes in #3028671: Add @trigger_error() to deprecated and already (almost) unused EntityManager methods and #3025427: Add @trigger_error() to deprecated EntityManager->EntityTypeBundleInfo methods
Comment #23
BramDriesenLooks good from my perspective, also the tests are passing so that's great. Maybe some one else can also have a look at it?
RTBC for me.
Comment #24
andypostComment #25
larowlanissue credits
Comment #26
larowlanCommitted 37d2299 and pushed to 8.8.x. Thanks!