A single minded issue to refactor the usage of entity.manager in preparation for D9.

In service of Bedir's comment here.

https://www.drupal.org/project/flag/issues/3042758#comment-13326289

Comments

martin107 created an issue. See original summary.

martin107’s picture

Assigned: martin107 » Unassigned
Status: Active » Needs review
StatusFileSize
new1.12 KB

A summary of this patch

Two - one line changes.

oknate’s picture

StatusFileSize
new1.07 KB
new1.58 KB

The $flag_storage variable is unnecessary. Minor update to the test. Other than that, I think this is fine.

berdir’s picture

Status: Needs review » Needs work
+++ b/flag.services.yml
@@ -25,7 +25,7 @@ services:
   flag.link_builder:
     class: Drupal\flag\FlagLinkBuilder
-    arguments: ['@entity.manager', '@flag']
+    arguments: ['@entity_type.manager', '@flag']
   flag.twig.count:
     arguments: ['@renderer', '@url_generator', '@theme.manager', '@date.formatter', '@flag.count']

FlagLinkBuilder *does* type hint on EntityTypeManagerInterface, but it still has docblocks and variables named after $entity_manager, so lets clean that up.

berdir’s picture

Case insensitive regex search for `entity.?manager`is pretty good at finding any left-overs. I have little bit of experience with removing entity.manager traces :p

martin107’s picture

Status: Needs work » Needs review
StatusFileSize
new3.69 KB
new2.11 KB

Thanks for the push back ...my mistake that was a good call.

I think this is good now. Certainly at least any entity.?manager errors have been resolved.

berdir’s picture

Status: Needs review » Fixed

No worries, thanks for the update, looks good now.

  • Berdir committed 4fdbe4e on 8.x-4.x authored by martin107
    Issue #3090392 by martin107, oknate: entity.manager is deprecated
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.