Problem/Motivation
Steps to reproduce
Proposed resolution
Here is the patch. To fix issue: non-existent service "entity.manager". As entity manager service is split into different services. Reference: https://www.drupal.org/node/2549139
Remaining tasks
User interface changes
API changes
Data model changes


| Comment | File | Size | Author |
|---|---|---|---|
| #25 | hashtag Screenshot 2023-06-21.png | 83.96 KB | arpitk |
| #24 | 3270906-24.patch | 68.9 KB | tmaiochi |
| #24 | interdiff_22-24.txt | 9.19 KB | tmaiochi |
| #22 | resolved-coding-standards-3270906-22.patch | 68.39 KB | libbna |
| #11 | dependency-injection-3270906-11.patch | 1.58 KB | ruturaj chaubey |
Issue fork hashtags-3270906
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
vshlbndr commentedHere is the patch to resolve the issue.
Comment #3
guptahemant commentedComment #4
ruturaj chaubeyCan you use dependency injection instead of using the services via the Drupal global class.
Can you use dependency injection instead of using the services via the Drupal global class.
Comment #5
ruturaj chaubeyComment #6
Johnny Santos commentedI'm going to work as demanded on comment #4
Comment #7
Johnny Santos commentedJust finished what is demanded on one of the files, but I noticed that "hashtags.install" is not possible to make a dependency injection since its a procedural file(it does not contains classes).
Comment #8
vighneshh commentedI will review This..
Comment #9
vighneshh commentedI Tried applying this patch
3270906-7.patchAnd the patch failed returning this error meesage.this patch needs work.
Comment #10
ruturaj chaubeyComment #11
ruturaj chaubeyAdded the necessary changes in this patch.
Comment #12
victoria-marina commentedI'll review this.
Comment #13
victoria-marina commentedThe #11 successfully adds the dependency injection into the file. Looks good!
Comment #14
vighneshh commentedStill seeing this coding standard issue when run phpcs --standard=DrupalPractice /var/www/html/alldemo/web/modules/contrib/hashtags/src/Form/ManagerForm.php
Comment #15
vighneshh commentedAdding a patch for the necessary changes in issue mention at #14.
Comment #16
libbna commentedI will review this.
Comment #17
libbna commentedThere are no errors related to Dependency Injection but found these extra errors.
Comment #18
libbna commentedComment #19
victoria-marina commentedWorking on this.
Comment #20
victoria-marina commentedI made a patch to fix the warnings below:
I didn't fix this one because I think it needs further analysis.
Kindly review it.
Comment #21
libbna commentedI will review this.
Comment #22
libbna commentedafter applying #20 patch found few issues. I have resolved them and created a patch.
Comment #23
tmaiochi commentedI'll review this!
Comment #24
tmaiochi commentedIn my review, I came across some errors like:
Notice: Undefined property: Drupal\hashtags\Form\ManagerForm::$entity_typeInfo in Drupal\hashtags\Form\ManagerForm->buildForm()I realized that the wrong variable was used that's why this error triggered, after changing to the correct variable I still had another error:
Warning: Illegal string offset 'label' in Drupal\hashtags\Form\ManagerForm->buildForm()So I decided to refactor all the code from the
ManagerForm.phpfile and after refactoring it I tested it again and there were no more previous errors.Kindly review it!
Comment #25
arpitk commentedHi I tried the patch #24 but it didnt apply cleanly.
Thanks!
Comment #26
keshavv commentedI appreciate all your efforts.
But the issue is regarding Non-existent service "entity.manager"
So please fix the issue only related to that. Otherwise we will go nowhere.
Thank you.
Comment #29
roshni27 commentedI have reviewed patches #7 and #11, and they have been applied cleanly. In both patches, the variable $this->entity_typeInfo is being used, but in the defined variable, the name is protected as $entityTypeInfo.
Even though entity_type.bundle.info is injected into the code, it is still being referenced as
$bundle_info = $this->entity_typeInfo->get('entity_type.bundle.info');
$bundles = $bundle_info->getBundleInfo($entity_type);.
I believe it would be more appropriate to use it as follows:
$bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type).
I have created a merge request. Please take a moment to review it.