For components implementing the new routing linked to menu items, all menu items links are broken when executing Joomla with raw URLs or URLs not routed to any menu items such as 'component/contact'
Opening a Joomla link such as http://www.domain.com/component/contact, http://www.domain.com/component/tags or using a raw link such as a link to generate a sitemap http://www.mysite.com/index.php?option=com_osmap&view=xml&tmpl=component&id=1
will result in all Joomla menu items links broken if the linked component implements the new view based router.
All links are broken, they don't stay the same as when clicking on a menu item having an alias.
Appending a casual alias before the raw link, even if a not existent alias, all links are generated again correctly.
http://www.mysite.com/randomstringalias/index.php?option=com_osmap&view=xml&tmpl=component&id=1
Testing Joomla 3.6 dev branch
Labels |
Added:
?
|
@joomlajoe See #9953
Is that the problem you are reporting here?
Category | ⇒ | Router / SEF |
@joomlajoe Is this using the 3.6 branch?
Notifying @hackwar
Yes i found the exact line to fix the issue.
It's happening in the JComponentRouterRulesMenu preprocess function.
Code at line 125 set the default Itemid overwriting the one in $query array already present:
if (!empty($default->id))
{
$query['Itemid'] = $default->id;
}
to fix the issue this should be changed as following:
if (!empty($default->id) && empty($query['Itemid']))
{
$query['Itemid'] = $default->id;
}
Please notify @Hackwar
To reproduce this it's easy, i just installed a 3.6 branch with few sample data. Navigating menu and observing menu links everything is ok.
Trying to open a link such as http://test36/component/contact, etc and observing menu links you will notice they are broken in most cases, for example always pointing to the home page or: http://test36/en/component/users/?Itemid=101
Milestone |
Added: |
Milestone |
Added: |
Hi In my joomla 3.5.1 error logs I too get the following.
PHP Warning: array_merge(): Argument #2 is not an array in public_html/libraries/cms/router/router.php on line 350
PHP Fatal error: Unsupported operand types in public_html/libraries/cms/router/router.php on line 234
Is the above code a fix for this error and if so where exactly does it go.
@crazynex No, this has nothing to do with your issue. That code is not active yet and your issue will have a different source.
@joeforjoomla The code is the same as we have in Joomla right now. The issue looks more like a configuration issue on your end.
I can no longer replicate this on the 3.7 branch. On my local copy going to http://localhost/~george/joomla-cms/component/content and http://localhost/~george/joomla-cms/component/tags and both perfectly accessible
I can also access http://localhost/~george/joomla-cms/index.php?option=com_content&view=article&id=1 without issues
I'm going to close this issue. If you can replicate it please feel free to and provide a bit more information!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-10 20:55:16 |
Closed_By | ⇒ | wilsonge |
I currently tested again but the issue is still there in the 3.7 dev https://developer.joomla.org/nightlies/Joomla_3.7.0-dev-Development-Full_Package.zip
Let me know if i should test another branch.
By the way the problem is not about accessing pages as you say; http://localhost/~george/joomla-cms/component/tags
The problem is that if a page link is not routed to any menu item all links from components using the new router or even not using the new router generated by Joomla menus are broken.
See self explaining screenshots below, accessing normal page link with a routed menu item alias like http://joomla37/en/about you see that the log out menu item has correct link: http://joomla37/en/log-out
Accessing normal page link without a routed menu item alias like http://joomla37/en/component/tags you see that the log out menu item has broken link: http://joomla37/en/component/users/?Itemid=101
Let me know if i should test another branch, also notice that i provided a fix for this issue months ago.
Status | Closed | ⇒ | New |
Closed_Date | 2016-09-10 20:55:16 | ⇒ | |
Closed_By | wilsonge | ⇒ |
Ahh ok I understand now. Thanks for the screenshots! That helps a lot!
You are welcome George, happy to help if possible :)
I just tested again everything and i can confirm that the issue is still there!
PS: should be marked as release blocked i think
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-12 20:32:53 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
I can't seem to reproduce this issue. Can you give me the exact steps you took, starting from a fresh install with default sample data, that lead to getting broken links?