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

Fixed missing event manager for form AssetEditForm. #2236

Closed

Conversation

Daniel-KM
Copy link
Contributor

No description provided.

@zerocrates
Copy link
Member

The bug here is that the event manager isn't being injected for this form so you're getting a "local only" one that doesn't connect to the shared event manager and modules therefore can't attach listeners to it?

Daniel-KM pushed a commit to Daniel-KM/Omeka-S-module-EasyAdmin that referenced this pull request Nov 5, 2024
@Daniel-KM
Copy link
Contributor Author

The form is not declared in the config so it does not load the shared event manager. In fact, the trait allows to load one event manager, but there is no events inside it. So it is like the SiteFormFactory for example.

@zerocrates
Copy link
Member

zerocrates commented Nov 8, 2024

Since so many forms need this injected, I think I might instead fix this with an initializer that auto-injects the event manager for any form that implements EventManagerAwareInterface: that pattern's already used by Laminas itself for the top-level service manager and controllers, we're doing something similar for API adapters, etc.

@zerocrates
Copy link
Member

I went ahead with that strategy, and my review of the forms also noted the same problem in the newer BlockLayoutDataForm and PageLayoutDataForm.

@Daniel-KM Daniel-KM deleted the fix/eventmanager_for_asset_form branch November 13, 2024 20:04
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

Successfully merging this pull request may close these issues.

2 participants