joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.2] Finder Router: filter out unnecessary query elements

Open Hackwar opened this issue 1 year ago • 4 comments

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

Hackwar avatar Sep 11 '24 12:09 Hackwar

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.

ghost avatar Sep 12 '24 10:09 ghost

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


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.

ghost avatar Sep 12 '24 10:09 ghost

@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">

ghost avatar Sep 13 '24 05:09 ghost

@Hackwar I'm here if you need a test on any update.

uglyeoin avatar Oct 08 '24 19:10 uglyeoin

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 avatar Nov 28 '24 12:11 dautrich

@dautrich You didn't get information mentioned in https://github.com/joomla/joomla-cms/pull/44055#issuecomment-2345830447?

ghost avatar Nov 28 '24 15:11 ghost

@fgsw No, everything looked perfect. The display was identical with and without the patch. Only the URL changed.

dautrich avatar Nov 28 '24 15:11 dautrich

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.

viocassel avatar Nov 29 '24 23:11 viocassel

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44055.

Quy avatar Nov 29 '24 23:11 Quy

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">

Screenshot from 2024-12-02 15-32-50

pe7er avatar Dec 02 '24 14:12 pe7er

I modified this. Can you please test again?

Hackwar avatar Jan 16 '25 08:01 Hackwar

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.

dautrich avatar Jan 16 '25 08:01 dautrich

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.

ghost avatar Jan 16 '25 08:01 ghost

Thanks all.

richard67 avatar Jan 18 '25 10:01 richard67