? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
27 Oct 2016

Pull Request for Issue #12558.

Components may break in some case if accessed using an URL like http://localhost/joomla/en/index.php?option=com_contact. The reason is that due to some faulty routing the request parameters from the default menu item are added. This is likely at least a view parameter (eg "view=article"). Now since the original request didn't specify a view and expected the default view of the component to be executed. But that view parameter from the menu item now becomes active and since that view doesn't exist in the requested component it blows up in an error page.

Summary of Changes

The language filter plugin removes the language tag from the JUri path during its parseRule method. This is needed so further processing of the routing doesn't work from a wrong menu path, for the homepage, this path should be empty.
Now with that specific request, the index.php ends up in the path, making it non-empty. The further routing parsing now wrongly assumes this is part of the SEF URL and comes to wrong conclusions in the end.

This PR empties the $parts array before setting it to the JUri->path if index.php is the only part left in that array.

Testing Instructions

  1. Set up a multilingual site with the language filter plugin active
  2. Enable SEF URLs and URL rewriting
  3. Set up a default homepage for the active language pointing to a single article
  4. Use link http://localhost/joomla/en/?option=com_contact (adjust to your testing site). This Link should work and give you the contacts categories view.
  5. Use link http://localhost/joomla/en/index.php?option=com_contact (note the index.php part). This Link should not work and give you a "View not found [name, type, prefix]: article, html, contactView" error page.
  6. Appy PR and try this link again, it should work now
  7. Try other configurations and links, they all should still work as expected.

Documentation Changes Required

None

avatar Bakual Bakual - open - 27 Oct 2016
avatar Bakual Bakual - change - 27 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Oct 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 27 Oct 2016
Category Front End Plugins
avatar infograf768 infograf768 - test_item - 28 Oct 2016 - Tested successfully
avatar infograf768
infograf768 - comment - 28 Oct 2016

I have tested this item successfully on d6b764e

Tested on legacy site. Solves the issue described using similar urls with and without index.php.

Tested remaining of site and did not remark any unwanted consequences


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

avatar joeforjoomla
joeforjoomla - comment - 28 Oct 2016

I have tested this item successfully both on the modern and legacy router.

avatar infograf768 infograf768 - change - 28 Oct 2016
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 28 Oct 2016

RTC. Thanks @Bakual


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

avatar joomla-cms-bot joomla-cms-bot - change - 28 Oct 2016
Labels Added: ?
avatar rdeutz rdeutz - change - 29 Oct 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-10-29 09:38:56
Closed_By rdeutz
avatar rdeutz rdeutz - close - 29 Oct 2016
avatar rdeutz rdeutz - merge - 29 Oct 2016
avatar zero-24 zero-24 - close - 29 Oct 2016
avatar zero-24 zero-24 - change - 29 Oct 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment