Safely extend plugin classes

Created on 12 May 2025, 21 days ago

Problem/Motivation

A lot of plugin classes in the module use the old extend the constructor method. This causes the constructor to break anytime there in a change in the parent plugin class. There is a new way to extend those for injecting services without extending the constructor that we should be using instead.

Also there in a dependency injection anti-pattern in use for assigning entity storage to a property which should be avoided.

Steps to reproduce

Proposed resolution

Avoid using constructors in extended plugin classes:
https://www.previousnext.com.au/blog/safely-extending-drupal-10-plugin-c...
https://www.drupal.org/node/3468511 β†’
https://www.drupal.org/node/3076421 β†’

Assigning entity storage to a property instead of the entity manager:
https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024