Problem/Motivation

"core/modules/node/src/Plugin/migrate/source/d6/Node.php" "__construct" method uses variable of type "ModuleHandler" instead of "ModuleHandlerInterface".

This is the __construct definition:

  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityTypeManagerInterface $entity_type_manager, ModuleHandler $module_handler) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state, $entity_type_manager);
    $this->moduleHandler = $module_handler;
  }

This throws an error when e.g. decorating the module handler. See #3499285: Refactor to decorate ModuleHandler instead of HMIA, to make it work in Drupal 10 with Drush 13 in contrib for example.

Steps to reproduce

Proposed resolution

Use "ModuleHandlerInterface" instead.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3512815

Command icon 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

grevil created an issue. See original summary.

grevil’s picture

Status: Active » Needs review

Simple but effective change. Please review!

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @grevil, code-wise seems quite obvious that the Interface should be used! Guess it's simply old code?

anybody’s picture

anybody’s picture

anybody’s picture

Issue summary: View changes

  • catch committed 02a4dc77 on 10.5.x
    Issue #3512815 by grevil: "core/modules/node/src/Plugin/migrate/source/...

  • catch committed cdd9e92a on 11.x
    Issue #3512815 by grevil: "core/modules/node/src/Plugin/migrate/source/...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 10.5.x, thanks!

Status: Fixed » Closed (fixed)

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