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

BeforeSearchFormIsShownEvent is immutable #4213

Open
snk-spo opened this issue Nov 6, 2024 · 3 comments
Open

BeforeSearchFormIsShownEvent is immutable #4213

snk-spo opened this issue Nov 6, 2024 · 3 comments

Comments

@snk-spo
Copy link
Contributor

snk-spo commented Nov 6, 2024

The BeforeSearchFormIsShownEvent is currently immutable. It has no setters or public variables whatsoever. This makes it pretty useless.

I wanted to inject some variables into the Search Form Template using this event, then found out that the event object can not be altered. An event should allow to actually alter or atleast add some variables when the event is fired.

ext:solr v12, TYPO3 v12, PHP v8.3.

@dkd-kaehm
Copy link
Collaborator

dkd-kaehm commented Nov 6, 2024

Sometimes it is important to disallow the changes/side-effects, but allow the information retrieval.
Which property do you want to override?

Edit: IMHO additionalFilters only is relevant for changes.

@snk-spo
Copy link
Contributor Author

snk-spo commented Nov 8, 2024

Edit: IMHO additionalFilters only is relevant for changes.

But this is immutable as well. I expected this event to provide the possibility to add (new, additional) template variables (which I then can use in my overridden Fluid template). I now created an extra ViewHelper to fetch it from inside the Search Form Template (which I see as spaghetti, beause Fluid Templates should not have any fetch logic, but get all stuff passed pre-calculated into).

@dkd-kaehm
Copy link
Collaborator

Edit: IMHO additionalFilters only is relevant for changes.

But this is immutable as well. I expected this event to provide the possibility to add (new, additional) template variables (which I then can use in my overridden Fluid template). I now created an extra ViewHelper to fetch it from inside the Search Form Template (which I see as spaghetti, beause Fluid Templates should not have any fetch logic, but get all stuff passed pre-calculated into).

Please provide your suggestion as pull-request.

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

2 participants