? Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
26 Dec 2021

Pull Request for Issue #35497.

Summary of Changes

The Smart Search module adds all get fields of the form route as additional hidden input fields to the search form. The router always adds the Itemid to the URL and thus will also always add the Itemid as hidden input field. Since the code in line 42 however doesn't check the processed URL, but just the unSEFed URL, it will often enough not contain the Itemid. Long story short: The code in line 42 doesn't find an Itemid and thus adds it in addition, while the code in line 45 adds the Itemid (via the router) and then line 49 adds it a second time. We can simply drop this whole "check for Itemid" code. Either the Itemid is a valid Smart Search menu item, then it will create a nice SEF URL, no Itemid will be in the query in line 49, or the Itemid is part of the get query and will be added as hidden input.

Testing Instructions

I'm copying the instructions by @brianteeman here, since they are perfect for this.

Steps to reproduce the issue PART 1

Create a smart search module. Do not create a search menu item or set an ItemID in the module
image

Then visit the front end and perform a search with the module

Actual result BEFORE applying this Pull Request

The url is example.com/component/finder/search?q=&Itemid=101&Itemid=101

Expected result AFTER applying this Pull Request

The url is example.com/component/finder/search?q=&Itemid=xxx

Steps to reproduce the issue PART 2

Repeat the test but this time add a search menu item or set an ItemID in the module

Then visit the front end and perform a search with the module

Actual result BEFORE applying this Pull Request

The url is example.com/component/finder/search?q=&Itemid=101&Itemid=xxx
where xxx is the id of the search menu item or the id of the menu item selected in the module
where 101 is the id of the default home page

Expected result AFTER applying this Pull Request

The url is example.com/component/finder/search?q=&Itemid=xxx
where xxx is the id of the search menu item or the id of the menu item selected in the module

avatar Hackwar Hackwar - open - 26 Dec 2021
avatar Hackwar Hackwar - change - 26 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Dec 2021
Category Modules Front End
avatar Hackwar Hackwar - change - 26 Dec 2021
Labels Added: ?
avatar brianteeman brianteeman - test_item - 27 Dec 2021 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 27 Dec 2021

I have tested this item ? unsuccessfully on 077a5e8

When the module is set to use a specific menu item this does not work. it just uses 101


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

avatar Hackwar
Hackwar - comment - 20 Jan 2022

Closing this PR in favour of #36750

avatar Hackwar Hackwar - close - 20 Jan 2022
avatar Hackwar Hackwar - change - 20 Jan 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-01-20 08:08:43
Closed_By Hackwar

Add a Comment

Login with GitHub to post a comment