TYPO3-Solr / ext-solr

A TYPO3 extension that integrates the Apache Solr search server with TYPO3 CMS. dkd Internet Service GmbH is developing the extension. Community contributions are welcome. See CONTRIBUTING.md for details.
GNU General Public License v3.0
137 stars 249 forks source link

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

Open davidjakob opened 5 months ago

davidjakob commented 5 months ago

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):

dkd-kaehm commented 5 months ago

Please provide a Pull-Request for that issue.

simplethingsgmbh commented 5 months ago

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.