User tests: Successful: Unsuccessful:
Fixing the bugs described here: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=31107
Can this fix not be fast-tracked into 3.1.2 before a better class is designed to avoid the duplication?
I'd personally take it as is to get the bug fixed then work out optimization for 3.2. My "optimal" solution is as suggested above, finally having our route helpers extend the newer JHelperRoute
and avoiding the duplicated code. The view class changes IMO are nice but not 100% related to this.
Completely agreed :) That's what I was trying to say (just less well!)
Please first accept this PR and then later nuke JHelperRoute. As I described in several places already, the concept of the *HelperRoute classes is wrong both in practice and in system-theory. It is one of the three big problems in Joomla routing and we should do everything, but please don't encourage people to use this flawed and broken concept. I provided code that implements the routing in a proper fashion on the mailinglist. Please look at that and evaluate it first before forcing us deeper down the HelperRoute-nightmare. Thank you.
Works for me, I was just thinking out loud.
This totally breaks associations in multilanguage.
[20-Jul-2013 06:40:05 UTC] PHP Fatal error: Call to a member function getPath() on a non-object in /Applications/MAMP/htdocs/testwindows/trunkgitnew/components/com_content/helpers/route.php on line 88
Tested further:
It looks like this is related to the Similar Tags module when present on the page.
Correction again:
It looks like this happens when the Category is set to registered and not public and one is not logged in.
I thought we could live without that extra check, but apparently... I added a check to fix this.
We still have, when the category is registered (same conditions as above)
Notice: Undefined index: id in /Applications/MAMP/htdocs/testwindows/trunkgitnew/components/com_content/router.php on line 59
That looks more like an additional/unrelated bug in the router. I have to say however, that I would point my finger at the code that invokes ContentHelperRoute instead of ContentHelperRoute itself. Right now, ContentHelperRoute is "bug free".
There seems to be an issue with the sample data routing. Clean install of master using sample data, Click on Article Category List -> click on Subcategory Extension -> click on Subcategories Modules. You now get an empty page. The URL changes from article-category-list/20-extensions to article-category-list/22-extensions/. The same thing happens still with this PR applied.
I discovered a few more bugs in the routing of Joomla, but I will open another PR for those issues. Maybe you need to rebuild your category/menu table to fix this.
Hi Michael, why did you close this one? This PR is still valid for Joomla 3.1.x. So far you only merged the PR for Joomla 2.5. Please re-open it and merge it. Thanks.
Ok, sorry, I misinterpreted the message by github here apparently.
I'm going to make a bold suggestion here. We have
JHelperRoute
now which IIRC was built to help with code cleanup in these route classes (com_tags does just that). Maybe its time to do the same with the other classes so that we don't have to duplicate the language lookup query (and that inherently makes the same lookup available immediately to all route helpers starting when it is introduced).