? Success

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
21 Apr 2014

This is just #255 but for staging instead of master.
It's for this tracker item: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28754

avatar okonomiyaki3000 okonomiyaki3000 - open - 21 Apr 2014
avatar okonomiyaki3000 okonomiyaki3000 - change - 21 Apr 2014
Title
Don't set the (wrong) Item id.
[#28754] Don't set the (wrong) Item id.
avatar Bakual
Bakual - comment - 25 May 2014

Unfortunately, this only works if there is a menu item for the smart search component.

If there is no menu item, the result page will be shown without an Itemid (index.php?q=blabla&option=com_finder&view=search)
I guess this was the original reason for this funny code.

Maybe a solution would be to use FinderHelperRoute::getSearchRoute() to build the URL. I didn't test but usually this takes care of a proper Itemid.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 25 May 2014

Why would you need an item id? If there's a menu item, we should use it. If there's not, then any id we use will actually be borrowed from some other, unrelated menu item. We'll end up with inappropriate modules or other weird effects. If no menu item has been configured, the results page should just be completely dynamic.

avatar Bakual
Bakual - comment - 26 May 2014

In Joomla you always need an Itemid. Otherwise module and template style assignments are broken.
It should use the current Itemid as long as there is no better matching one.

Imagine you have the search module assigned on a page and you also assigned a special template style to that page. Like for example a special category of your site or even an ecommerce thing. Maybe even the menu module is special,
With your PR if the user performs a search he will end up on the default template style and the search and menu module is no longer visible. Currently, the template style will be the same and the modules still show.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 28 May 2014

Well, it's easy enough to do that but it raises another question. In the case that you have no menu item configured for a search results page, you just want to return to the same menu item but display the search results there instead of the normal content, right?

Well, what do you want as a url then? You could have one of these:

  • <routed-url-of-this-menu-item>?q=<search-term>&option=com_finder&view=search
  • component/finder/search?q=<search-term>&view=search&Itemid=<Itemid>

I believe currently you will get the latter but I can change it to the former if that's preferable.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 28 May 2014

Actually, now that I think about it, that's probably a bigger change that should be outside the scope of this PR. For now I will keep the routing as it is.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 25 Jul 2014

There are some instructions on the tracker but it still might not be clear enough.

Setup

  • Create a com_finder search results menu item.
  • Create a mod_finder search module that appears on all pages except the search results page (because why would you want it there?).
  • Use SEF urls.

Before

When you search using the module from some page other than the search results page (let's say it's Itemid 42), you will expect to get redirected to your results page (and you will) but, in addition to the basic SEF url of the search results page, your redirect page will have a query string that contains Itemid=42 (or whatever was the id of the page you searched from). You are not on Itemid 42. You are on the search result page, whatever Itemid it happened to be. However, you will see the modules that are supposed to be displayed on Itemid 42 rather than the ones for your results page. So that, in this case, you will see the mod_finder module even though you specifically set it to not show on the results page.

After

The Itemid will not be appended to the redirect url. The correct modules will appear on the search results page.

This patch only fixes the issue with mod_finder. It does not address the deeper problem of Joomla using the query string Itemid instead of the Itemid implicit in the SEF url when determining which modules to display.

avatar wilsonge
wilsonge - comment - 27 Jul 2014

RTC

avatar dbhurley dbhurley - change - 27 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-27 17:50:46
avatar dbhurley dbhurley - close - 27 Jul 2014
avatar dbhurley dbhurley - close - 27 Jul 2014
avatar okonomiyaki3000 okonomiyaki3000 - head_ref_deleted - 28 Jul 2014
avatar Sophist-UK Sophist-UK - reference | 74f89b2 - 7 Oct 14

Add a Comment

Login with GitHub to post a comment