Skip to content

Commit

Permalink
Fix bug of always expanding extended search form (#151)
Browse files Browse the repository at this point in the history
Fix bug of always expanding extended search form
  • Loading branch information
mh-goe authored and ipf committed May 20, 2019
1 parent 1d26735 commit 4aca57b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
14 changes: 12 additions & 2 deletions Classes/Service/SolrServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,18 @@ public function isExtendedSearch()
&& array_key_exists($fieldInfo['id'], $this->requestArguments['q'])
&& $this->requestArguments['q'][$fieldInfo['id']]
) {
$result = true;
break;
// Check if the request argument is an array itself (appies to field type "Range")
if (is_array($this->requestArguments['q'][$fieldInfo['id']])) {
foreach ($this->requestArguments['q'][$fieldInfo['id']] as $key => $value) {
if ('' !== $value) {
$result = true;
break;
}
}
} else {
$result = true;
break;
}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/ViewHelpers/Page/ScriptViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public static function renderStatic(

if ($scriptPath) {
$pageRenderer->addJsFooterLibrary($name, $scriptPath);

return '';
}

Expand All @@ -93,11 +94,11 @@ public static function renderStatic(
if ($fileNameFromArguments) {
$scriptPath = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Resource\FilePathSanitizer::class)->sanitize($fileNameFromArguments);
$pageRenderer->addJsFooterLibrary($name, $scriptPath);
}
else {
} else {
$content = $renderChildrenClosure();
$pageRenderer->addJsFooterInlineCode($name, $content);
}

return '';
}
}
Expand Down

0 comments on commit 4aca57b

Please sign in to comment.