Problem/Motivation

Some classes, such as MyrestMetatagAdminController, currently use static calls to \Drupal::service() or the \Drupal container. This approach is deprecated and hinders testability.

Proposed resolution

  • Add create() method to MyrestMetatagAdminController.
  • Inject EntityTypeManagerInterface and other required services via the constructor.
  • Review other classes for static \Drupal usage and refactor them to use DI.

Remaining tasks

Refactor controllers and forms to use proper DI.

User interface changes

None.

API changes

Constructors of modified classes will change to support DI.

Data model changes

None.

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

sergeydruua created an issue. See original summary.

sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)