? Success

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
22 Nov 2014

In one of the last routing PRs, the JApplicationCms and JMenu objects were handed over to the constructor of the component routers. This allows to have test-objects be injected into the routers or to change the original objects where necessary.

This PR implements this change in the core routers by modifying the JComponentRouterBase class and subsequently changing the code in the core routers to use the new objects of the class.

I've been trying to decide if this is backwards compatible for a while longer. Not so much because the core routers are slightly changed, but because JComponentRouterBase is changed in that it gets a constructor and that this constructor accepts 2 parameters. If a developer wrote his own router class which extends from JComponentRouterBase and which has its own constructor, but does not call the parent constructor, $this->app and $this->menu would not be available to the router. But then again, those routers would not use $this->app and $this->menu in their code anyway. The only way this could go wrong, would be if a developer extends a core router and has his own constructor written for it, that does not call the parent constructor. This is a VERY unlikely construct and I would say that this is equally possible to winning the lottery and being struck by lightning at the same time. So I think we are safe here. (I'm just trying to cover all our bases here.)

Testing instructions: Apply the change and simply see that nothing is broken.

This was made possible through the generous donation of the people mentioned in the following link via an Indiegogo campaign: http://joomlager.de/crowdfunding/5-contributors

avatar Hackwar Hackwar - open - 22 Nov 2014
avatar jissues-bot jissues-bot - change - 22 Nov 2014
Labels Added: ?
avatar dgt41
dgt41 - comment - 22 Nov 2014

@test success Works like a charm :+1:

avatar wilsonge
wilsonge - comment - 23 Nov 2014

Why are we injecting the application object? It's not being used by any of these classes except to get the menu object?

avatar Hackwar
Hackwar - comment - 23 Nov 2014

Yes, so far that is true, but I wanted to be proactive and have this available, among other things to have access to the application configuration. Think of it as "Advanced SEF" not per component but globally.

avatar wilsonge
wilsonge - comment - 23 Nov 2014

Fair enough :smile:

avatar chivitli
chivitli - comment - 24 Nov 2014

+1 from me. I have a component with router that extends JComponentRouterBase, everything works fine still.

avatar Hackwar
Hackwar - comment - 24 Nov 2014

That makes it 2 successfull tests and a happy @wilsonge. Could someone (George?) set this to RTC? I don't want to do it myself, since I provided the patch...

avatar wilsonge wilsonge - change - 24 Nov 2014
Status Pending Ready to Commit
avatar wilsonge
wilsonge - comment - 24 Nov 2014

RTC

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

avatar phproberto phproberto - close - 27 Nov 2014
avatar phproberto phproberto - close - 27 Nov 2014
avatar phproberto phproberto - change - 27 Nov 2014
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2014-11-27 16:29:07
avatar Hackwar
Hackwar - comment - 27 Nov 2014

thx

avatar Hackwar Hackwar - head_ref_deleted - 10 Dec 2014

Add a Comment

Login with GitHub to post a comment