@@ -191,10 +191,7 @@ public function mainAction(): ResponseInterface
191191 $ solrResults = $ this ->documentRepository ->findSolrWithoutCollection ($ this ->settings , $ this ->search , $ listedMetadata , $ indexedMetadata );
192192 $ numResults = $ solrResults ->getNumFound ();
193193
194- $ itemsPerPage = $ this ->settings ['list ' ]['paginate ' ]['itemsPerPage ' ];
195- if (empty ($ itemsPerPage )) {
196- $ itemsPerPage = 25 ;
197- }
194+ $ itemsPerPage = $ this ->settings ['list ' ]['paginate ' ]['itemsPerPage ' ] ?? 25 ;
198195 $ solrPaginator = new SolrPaginator ($ solrResults , $ currentPage , $ itemsPerPage );
199196 $ simplePagination = new SimplePagination ($ solrPaginator );
200197
@@ -275,7 +272,7 @@ private function makeFacetsMenuArray(array $facets): array
275272 $ searchParams = $ this ->search ;
276273 if (
277274 (array_key_exists ('fulltext ' , $ searchParams ))
278- || preg_match ('/ ' . $ fields ['fulltext ' ] . ':\((.*)\)/ ' , trim ($ searchParams ['query ' ]), $ matches )
275+ || preg_match ('/ ' . $ fields ['fulltext ' ] . ':\((.*)\)/ ' , trim ($ searchParams ['query ' ] ?? '' ), $ matches )
279276 ) {
280277 // If the query already is a fulltext query e.g using the facets
281278 $ searchParams ['query ' ] = empty ($ matches [1 ]) ? $ searchParams ['query ' ] : $ matches [1 ];
@@ -344,7 +341,7 @@ private function makeFacetsMenuArray(array $facets): array
344341 'mincount ' => '1 ' ,
345342 'key ' => $ field ,
346343 'field ' => $ field ,
347- 'limit ' => $ this ->settings ['limitFacets ' ],
344+ 'limit ' => $ this ->settings ['limitFacets ' ] ?? 15 ,
348345 'sort ' => isset ($ this ->settings ['sortingFacets ' ]) ? $ this ->settings ['sortingFacets ' ] : 'count '
349346 ];
350347 }
@@ -517,7 +514,7 @@ private function processResults($facet, array $facetCollectionArray, array $sear
517514 $ entryArray ['ITEM_STATE ' ] = 'IFSUB ' ;
518515 }
519516 $ entryArray ['_SUB_MENU ' ][] = $ this ->getFacetsMenuEntry ($ field , $ value , $ count , $ search , $ entryArray ['ITEM_STATE ' ]);
520- if (++$ i == $ this ->settings ['limit ' ] ) {
517+ if (++$ i == ( $ this ->settings ['limitFacets ' ] ?? 15 ) ) {
521518 break ;
522519 }
523520 } else {
@@ -587,7 +584,7 @@ private function addFieldsForExtendedSearch(): void
587584 private function enableSuggester (): void
588585 {
589586 // Add uHash parameter to suggest parameter to make a basic protection of this form.
590- if ($ this ->settings ['suggest ' ]) {
587+ if ($ this ->settings ['suggest ' ] ?? true ) {
591588 $ this ->view ->assign ('uHash ' , GeneralUtility::hmac ((string ) (new Typo3Version ()) . Environment::getExtensionsPath (), 'SearchSuggest ' ));
592589 }
593590 }
0 commit comments