Problem/Motivation
The entity.manager service (which returns an EntityManager that implements EntityManagerInterface) was deprecated in Drupal 8.0.x and "will be removed before 9.0.0".
We should remove it before that happens.
Proposed resolution
Fix this.
As of commit b222273 (the HEAD of 8.x-2.x as of 2018-02-16), all of the code passes around and/or type-hints the (supported) EntityTypeManagerInterface objects, but still requests the (deprecated) entity.manager services in auto_entitylabel.services.yml and various objects' public static function create(...) methods, so fixing this is, at minimum, a case of just changing the requested service name.
Even though it's not strictly necessary, for consistency (and following the precedent set in the patch in #6) this patch should rename the class properties which referenced the service (from $entityManager to $entityTypeManager).
Remaining tasks
Write a patchRe-roll patch- Review and feedback
- RTCB and maintainer feedback
- Commit
User interface changes
None.
API changes
This module's API doesn't change.
Data model changes
None.
Original report by [username]
EntityManager has been split into 11 classes (more info). So now EntityManager and EntityManagerInterface are deprecated.
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | interdiff_21-23.txt | 3.31 KB | kbrodej |
| #24 | 2856225-23.patch | 10.17 KB | kbrodej |
| #21 | interdiff_18-21.txt | 2.88 KB | kbrodej |
| #21 | 2856225-21.patch | 10.42 KB | kbrodej |
| #18 | interdiff_12_18.txt | 5.12 KB | bcizej |
Comments
Comment #2
Pavan B S commentedApplying the patch, please check
Comment #3
Pavan B S commentedComment #4
sutharsan commentedThank you for taking care of this. Better sooner than later. One comment though:
Restore this white space.
Comment #5
Pavan B S commentedThank you for the comment, i will be working on that issue.
Comment #6
Pavan B S commentedChanged as per the suggestion
Comment #7
dhruveshdtripathi commentedChanges applied cleanly.
Comment #8
purushotam.rai commentedLGTM
Comment #9
purushotam.rai commentedPatch needs to be rerolled.
Comment #10
mparker17The code in the 8.x-2.x branch has changed significantly in the last 11 months (i.e.: since #6), and when I tried to re-roll the patch, I got merge conflicts in every file, and there was even a deleted file!
So, to make sure I didn't miss anything, I re-created the patch from scratch (grepping for the service name
entity.managerand working from there). Since I didn't start from previous work, I can't generate an interdiff; sorry!Comment #11
mparker17Updated the issue summary.
Comment #12
nkoporecHi, tested the patch it applies cleanly but there's error when you try to add a node with auto entity enabled.Recreated your patch with a fix.
Comment #13
mparker17@nkoporec, thanks! :)
Comment #14
maaty388 commentedI rerolled the patch because Controller was removed.
Comment #15
nkoporecTested your patch @matjaz_zavski and it's working as expected.Thanks for the re-roll.Marking as RTBC.
Comment #16
colanHere's the missing interdiff from #14. (Always provide these when uploading patches when there are already patches. See Creating an interdiff for details.)
This looks wrong, or am I missing something?
entityManageris being added back in.Comment #17
colanComment #18
bcizej commentedRerolled the patch, reviewed the code and replaced variable namings from
$entity_managerto$entity_type_manager.Comment #19
bcizej commentedComment #20
sutharsan commentedParam description missing at various points.
New param description is missing.
New param description is missing.
See above. Looks like a pattern ...
See above
Comment #21
kbrodej commentedReviewed and tested the patch from #19, fixed some minor CS issue.
Comment #22
kbrodej commentedComment #23
sutharsan commentedAfter applying the patch I still find a number of "entity manager" string in the code.
One minor remark on the interdiff:
Usually comment lines are filled upto 80 chars. Although I can't find this in the docs https://www.drupal.org/docs/develop/standards/api-documentation-and-comm....
General remark: please keep patches on-topic. Combining various changes in one patch makes accepting the patch hard. I know the itch of finding other things in the code that needs to be addressed. Fixing them in a separate issue is, in the long term, usually the best.
Comment #24
kbrodej commentedHi. Reverted the change pointed out in #23 and replaced "entity manager" with "entity type manager" from comments as well.
Comment #25
sutharsan commented@kbrodej, thanks for sticking with the issue.
No more comments.
Comment #26
berdirThere's also the more general D9 issue over here: #3111526: Add Drupal 9 into the require section of composer.json. Considering that this project isn't very actively maintained, it might make sense to take care of all poblems in a single issue including the .info.yml change. Then the maintainer will only have to commit a single patch to make the module ready and spend a minimal amount of time on it.
It looks like there are no tests yet here, so it probably makes sense to do some manual testing then against a D9 installation because static analysis does not find all problems.
Comment #27
dqdWell, not exactly true ... I can't speak for myself since I have been added here quite recently to help out, but to stand up for the initial maintainers of this project: I assume the reasons for the temporary minimal activity has to do with the core label field initiative and the understandable plan to wait for to know which route to go with AEL after/if that gets in core. Many use cases for this project were based on the inflexibility of core title/label field, what maybe will change over the next time soon and could make a discussion about the AEL features in D9 cycle useful before any other tasks. For all who are following auto entitylabel to circumvent the title field, please also have a look into the momentary discussions about that in core.
@kbrodej, Pavan B S, nkoporec, benjamincizej, mparker17, colan, maaty388: Thanks for working and keeping up on this!
Comment #29
dqd