Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate, disuse EventDispatcherTrait #4313

Open
paul-m opened this issue Oct 11, 2024 · 0 comments
Open

Deprecate, disuse EventDispatcherTrait #4313

paul-m opened this issue Oct 11, 2024 · 0 comments
Labels
bug Good First Issue good issues for first time contributors

Comments

@paul-m
Copy link
Contributor

paul-m commented Oct 11, 2024

Current Behavior

Many services use Drupal\common\EventDispatcherTrait because we needed a backwards-compatibility layer between Drupal 8 and 9. See: #3592

Currently, no one should be using Drupal 8, and we don't have Drupal 9 in our testing matrix.

Furthermore, services should be injected into other services, avoiding the \Drupal pattern.

So let's deprecate EventDispatcherTrait and remove its usage in DKAN.

Expected Behavior

  • Add a @deprecated annotation to EventDispatcherTrait.
  • Inject the event_dispatcher service into classes that currently use the trait.
  • Modify those classes to use their own dispatcher instead of the one called in the trait.

Steps To Reproduce

See that we use EventDispatcherTrait.

Decide that it's not a good pattern.

Fix it.

Relevant log output (optional)

No response

Anything else?

No response

@paul-m paul-m added the bug label Oct 11, 2024
@paul-m paul-m added the Good First Issue good issues for first time contributors label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Good First Issue good issues for first time contributors
Projects
None yet
Development

No branches or pull requests

1 participant