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

[BUG] SearchFormViewHelper breaks on empty QueryParams and Body in Request. #4040

Open
davidjakob opened this issue May 15, 2024 · 2 comments · Fixed by #4042
Open

[BUG] SearchFormViewHelper breaks on empty QueryParams and Body in Request. #4040

davidjakob opened this issue May 15, 2024 · 2 comments · Fixed by #4042

Comments

@davidjakob
Copy link

SearchFormViewHelper breaks the Page if there are no QueryParameters in the Request.

            $arguments = $request->getQueryParams()[$pluginNamespace];
            ArrayUtility::mergeRecursiveWithOverrule($arguments, $request->getParsedBody()[$pluginNamespace]);

image

A Check resolves this Problem:

            $arguments = $request->getQueryParams()[$pluginNamespace] ?? [];
            $bodyArguments = $request->getParsedBody()[$pluginNamespace] ?? [];
            ArrayUtility::mergeRecursiveWithOverrule($arguments, $bodyArguments);

Used versions (please complete the following information):

  • TYPO3 Version: 12 latest
  • EXT:solr Version: 12.0.3
@dkd-kaehm
Copy link
Collaborator

Please provide a Pull-Request for that issue.

@simplethingsgmbh
Copy link

I can confirm that behaviour.
A warning is thrown in debug mode:

PHP Warning: Undefined array key "tx_solr" in vendor/apache-solr-for-typo3/solr/Classes/ViewHelpers/SearchFormViewHelper.php line 148

The parameter keepExistingParametersForNewSearches has to be set for this error.

dkd-kaehm pushed a commit to hnadler/ext-solr that referenced this issue May 16, 2024
Adds empty array defaults in SearchFormViewHelper::getExistingSearchParameters to prevent TYPO3 TypeError.

Fixes: TYPO3-Solr#4040
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 a pull request may close this issue.

3 participants