DynamicLocalTasks::__construct() incorrectly type-hints its first parameter to EntityTypeManager instead of EntityTypeManagerInterface, causing conflicts with alternate implementations of the EntityTypeManager like the one in devel/webprofiler:
Recoverable fatal error: Argument 1 passed to Drupal\entity_clone\Plugin\Derivative\DynamicLocalTasks::__construct() must be an instance of Drupal\Core\Entity\EntityTypeManager, instance of Drupal\webprofiler\Entity\EntityManagerWrapper given, called in /appli/apache/current/web/modules/contrib/entity_clone/src/Plugin/Derivative/DynamicLocalTasks.php on line 50 and defined in Drupal\entity_clone\Plugin\Derivative\DynamicLocalTasks->__construct() (line 38 of modules/contrib/entity_clone/src/Plugin/Derivative/DynamicLocalTasks.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | interdiff-2820360-15-18.txt | 881 bytes | vpeltot |
| #18 | conflict_with-2820360-18.patch | 8.67 KB | vpeltot |
| #9 | conflict_with-2820360-9.patch | 8.49 KB | andypost |
| #9 | interdiff.txt | 777 bytes | andypost |
Comments
Comment #2
fgmSuggested patch.
Comment #5
6lv1 commentedHello,
Good catch!
The same error is present on other pages, so I think we can extend you proposed solution to all files using EntityTypeManager.
Comment #6
fgmNow we would need to fix these failing tests.
Comment #7
andypostLet's see which tests fails now
Comment #9
andypostOne more fix, now only tests left
https://dispatcher.drupalci.org/job/drupal8_contrib_patches/2535/artifac...
Shows that search page and block can't be created
Comment #11
michelleIf you have the patches from #2800203: Event dispatcher for clone events and #2706639: Support for sub-entity cloning applied, then this one chokes composer. I made a modified version based on having those two already applied and am sharing here in case anyone else has the same issue. It could be used as a re-roll if those other two issues are committed first. Otherwise, the patch in #9 is still the one for general use.
Comment #12
michelleSorry, forgot to change the comment number from the filename. Uploading a new one to fix that.
Comment #13
ranelpadon commentedThis issue also happens when using the Varbase distribution which bundles the Entity Clone and Devel (Web Profiler) modules. Entity Clone is enabled by default, and once you enable the WebProfiler also, the fatal error happens. Using the idea behind the suggested patch resolves the issue.
Comment #14
andypostComment #15
colanRe-rolling #12 to be applied after #2706639: Support for sub-entity cloning. See that issue for its own prerequisites. The tests will fail as the prerequisites haven't been committed yet.
I couldn't generate an interdiff as generation failed, but here's the reject file.
Comment #18
vpeltot commentedComment #20
vpeltot commentedThanks @all
Comment #21
vpeltot commentedComment #22
colanvpeltot: Thanks for committing, but please change the status to Fixed (open). If there are any problems, we can discuss while it's still open. Otherwise, the system will automatically close in 2 weeks (if there's no discussion).
Comment #23
anybodyA new alpha2 release would be nice, containing this fix.