You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backend: Create a search filter (e.g. search only articles in specific categories)
Create a search menu item with this search filter
Create a second search menu item without this search filter (because you need these two search possibilities on different parts of your website)
Frontend: Search with menu item without search filter - results are ok
Search with menu item with search filter - results are ok
Search again with menu item without search filter - results are not ok because the search filter ID is still in the query string of the results URL ("...?q=your-search-word&f=1").
Expected result
Search results should always work without filter if no filter is assigned to the menu item.
Actual result
Search results do not work without filter if you did another search with filter previously.
System information (as much as possible)
Joomla 4.4.3, PHP 8.1
Additional comments
A fix would be to delete the "f" variable in the query string if no filter is assigned to the search menu item:
components\com_finder\src\Helper\RouteHelper.php
public static function getSearchRoute($f = null, $q = null) {
...
// Add the pre-defined search filter if present.
if ($f !== null) {
$uri->setVar('f', $f);
}
// MY CODE ADDITION
else {
$uri->delVar('f');
}
// END OF MY CODE ADDITION
...
}
The text was updated successfully, but these errors were encountered:
Steps to reproduce the issue
Expected result
Search results should always work without filter if no filter is assigned to the menu item.
Actual result
Search results do not work without filter if you did another search with filter previously.
System information (as much as possible)
Joomla 4.4.3, PHP 8.1
Additional comments
A fix would be to delete the "f" variable in the query string if no filter is assigned to the search menu item:
components\com_finder\src\Helper\RouteHelper.php
public static function getSearchRoute($f = null, $q = null) {
...
// Add the pre-defined search filter if present.
if ($f !== null) {
$uri->setVar('f', $f);
}
// MY CODE ADDITION
else {
$uri->delVar('f');
}
// END OF MY CODE ADDITION
...
}
The text was updated successfully, but these errors were encountered: