[5.2] Finder Router: filter out unnecessary query elements
Summary of Changes
When creating a Smart Search menu item with a filter, the ID of the filter is displayed in the URL after the search has been submitted. This PR refactors the router to remove the unnecessary parameter.
Testing Instructions
- Have something to search for in your Joomla installation, for example the testing sampledata.
- Create a filter for Smart Search with some stuff selected.
- Create a menu item for the Smart Search search view and select the filter in it.
- Go to the menu item in the frontend and search for something random.
Actual result BEFORE applying this Pull Request
The URL contains a query element like &f=2.
Expected result AFTER applying this Pull Request
The URL does not contain the &f= query element.
Link to documentations
Please select:
-
[ ] Documentation link for docs.joomla.org:
-
[X] No documentation changes for docs.joomla.org needed
-
[ ] Pull Request link for manual.joomla.org:
-
[X] No documentation changes for manual.joomla.org needed
I have tested this item :white_check_mark: successfully on cf51a65af56a661f6ee539b0b99f0e805db8ea35
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.
I have not tested this item.
Saw to late the red marked information /Applications/MAMP/htdocs/components/com_finder/src/Service/Router.php on line 69 /index.php/en/search?f=1&q=joomla" method="get" role="search"> above the search module:
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.
@Hackwar Same result /Applications/MAMP/htdocs/components/com_finder/src/Service/Router.php on line 69 /index.php/en/search?f=1&q=joomla" method="get" role="search">
@Hackwar I'm here if you need a test on any update.
I have tested this item :white_check_mark: successfully on 178d33d490fb70c6adc4eb6f282e9dc57bda0deb
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.
@dautrich You didn't get information mentioned in https://github.com/joomla/joomla-cms/pull/44055#issuecomment-2345830447?
@fgsw No, everything looked perfect. The display was identical with and without the patch. Only the URL changed.
I have tested this item :white_check_mark: successfully on 178d33d490fb70c6adc4eb6f282e9dc57bda0deb
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.
I encountered the same issue as fgsw. Tested with PHP 8.2, Joomla 5.2.2, after adding this PR, I get:
Warning: Undefined array key "f" in /usr/local/apache2/htdocs/components/com_finder/src/Service/Router.php on line 69 /index.php/search?f=2&q=templates" method="get" role="search">
I modified this. Can you please test again?
I have tested this item :white_check_mark: successfully on 6ba70688b26fb0cd2e830a0cbbd26f0fdf9614c1
Test using Patchtester on copy of real site.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.
I have tested this item :white_check_mark: successfully on 6ba70688b26fb0cd2e830a0cbbd26f0fdf9614c1
Test by using Prebuilt update package.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.
Thanks all.