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

Dispatcher doesn't support forgetting events #1033

Closed
lex0r opened this issue Jan 10, 2024 · 1 comment
Closed

Dispatcher doesn't support forgetting events #1033

lex0r opened this issue Jan 10, 2024 · 1 comment
Milestone

Comments

@lex0r
Copy link
Contributor

lex0r commented Jan 10, 2024

Winter CMS Build

dev-develop

PHP Version

8.1

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

When calling Event::forget('someEvent') the event's listeners are not removed. This is because of an additional $sorted array of listeners which is actually used in all meaningful operations inside this custom Dispatcher implementation.

Steps to replicate

  1. Subscribe and fire an event
  2. Forget the event
  3. Fire again

Expected result: none of the previous listeners reacted on the event. Actual result: the listeners still react to the event.

Workaround

No response

@lex0r lex0r added needs review Issues/PRs that require a review from a maintainer Type: Unconfirmed Bug labels Jan 10, 2024
@lex0r
Copy link
Contributor Author

lex0r commented Jan 10, 2024

See wintercms/storm#162

@LukeTowers LukeTowers added Status: Completed and removed Type: Unconfirmed Bug needs review Issues/PRs that require a review from a maintainer labels Jan 26, 2024
@LukeTowers LukeTowers added this to the 1.2.5 milestone Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants