? Pending

User tests: Successful: Unsuccessful:

avatar alex7r
alex7r
25 Jan 2017

Don't use autoloader if you want to include 'router.php' manually

Summary of Changes

Excluding router autoloader as Joomla have no in itself.

Testing Instructions

Issues can appear on case insensitive file systems as autoloader can try to load 'Router.php' according to passed 'ComponentRouter'.
If file would be found but without class in it there is gonna be Fatal error as Joomla requires 'router.php'.
And on case insensitive system it will lead to file loaded twice.

avatar alex7r alex7r - open - 25 Jan 2017
avatar alex7r alex7r - change - 25 Jan 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jan 2017
Category Libraries
avatar alex7r
alex7r - comment - 25 Jan 2017

Can somebody explain why build is failed?

avatar photodude
photodude - comment - 25 Jan 2017

Follow the link to the tests on travis then look at one of the failed versions such as this link
https://travis-ci.org/joomla/joomla-cms/jobs/195243081

1) JRouterSiteTest::testGetComponentRouter
Failed asserting that JComponentRouterLegacy Object (...) is an instance of class "SearchRouter".
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php:1347

Seems something in your change has broken the code result of the object being an instance of class "SearchRouter".

avatar alex7r
alex7r - comment - 25 Jan 2017

@photodude Yes, but by what means?

It's just it's modification inside method and is not causing SearchRouter not to load...

avatar photodude
photodude - comment - 25 Jan 2017

Try some general Unit testing debugging on Travis (or just do the same step 2/3 items in your local and run PHP unit from the command line)

  1. set up Travis to test your Repo of Joomla CMS (sign in to Travis with github and set it to test your fork)
  2. duplicate your branch
  3. in your duplicate branch Try doing a var_dump in testGetComponentRouter() to see what the object actually is (or if there is even an object)
  4. push to github (commit on github) to start a travis build to run the unit tests and see if you are getting what you expect in the object
avatar alex7r alex7r - change - 26 Jan 2017
Title
autoloading router fix
WIP:autoloading router fix
avatar alex7r alex7r - edited - 26 Jan 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Feb 2017

@alex7r can you please explain how to test this PR?

avatar alex7r
alex7r - comment - 22 Feb 2017

It's really isn't ready for tests yet as I've ended up with tests fail that was unclear to me and seems that time I had no moment to investigate this. So It's marked as work in progress.

I will add test instructions and common used way to reproduce as soon as possible.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Feb 2017

@alex7r now i know what "WIP" means.

avatar photodude
photodude - comment - 22 Feb 2017

It's just it's modification inside method and is not causing SearchRouter not to load...

@alex7r, It's how the unit test tests this method see this
https://github.com/joomla/joomla-cms/blob/master/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php#L1319-L1355

avatar rdeutz rdeutz - change - 27 May 2017
Labels Added: ?
avatar brianteeman
brianteeman - comment - 9 Sep 2017

It has been over six months the since this wip pr was created/updated . I am closing this at this time. It can always be reopened when updated.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 9 Sep 2017

@brianteeman close Issue?

avatar alex7r
alex7r - comment - 9 Sep 2017

Seems like it more 3rd party issue than the Joomla after deep testing, so for now let's ignore this.

avatar alex7r alex7r - change - 9 Sep 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-09-09 18:41:27
Closed_By alex7r
avatar alex7r alex7r - close - 9 Sep 2017

Add a Comment

Login with GitHub to post a comment