?
avatar photodude
photodude
24 Dec 2015

Something in the 3.4.7 changes started travis-CI to fail and put Jenkins status to unstable
http://build.joomla.org/job/cms/2913/
https://travis-ci.org/joomla/joomla-cms/jobs/98573432

PHP Fatal error: Call to a member function get() on null in /libraries/joomla/session/session.php on line 500

PHP Stack trace:
PHP   1. {main}() /libraries/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /libraries/vendor/phpunit/phpunit/phpunit:47
PHP   3. PHPUnit_TextUI_Command->run() /libraries/vendor/phpunit/phpunit/src/TextUI/Command.php:100
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /libraries/vendor/phpunit/phpunit/src/TextUI/Command.php:148
PHP   5. PHPUnit_Framework_TestSuite->run() /libraries/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:436
PHP   6. PHPUnit_Framework_TestSuite->run() /libraries/vendor/phpunit/phpunit/src/Framework/TestSuite.php:735
PHP   7. PHPUnit_Framework_TestSuite->run() /libraries/vendor/phpunit/phpunit/src/Framework/TestSuite.php:735
PHP   8. PHPUnit_Framework_TestCase->run() /libraries/vendor/phpunit/phpunit/src/Framework/TestSuite.php:735
PHP   9. PHPUnit_Framework_TestResult->run() /libraries/vendor/phpunit/phpunit/src/Framework/TestCase.php:705
PHP  10. PHPUnit_Framework_TestCase->runBare() /libraries/vendor/phpunit/phpunit/src/Framework/TestResult.php:601
PHP  11. PHPUnit_Framework_TestCase->runTest() /libraries/vendor/phpunit/phpunit/src/Framework/TestCase.php:749
PHP  12. ReflectionMethod->invokeArgs() /libraries/vendor/phpunit/phpunit/src/Framework/TestCase.php:889
PHP  13. JComponentRouterViewTest->testGetPath() /libraries/vendor/phpunit/phpunit/src/Framework/TestCase.php:889
PHP  14. JComponentRouterView->getPath() /tests/unit/suites/libraries/cms/component/router/JComponentRouterViewTest.php:139
PHP  15. call_user_func_array:{/libraries/cms/component/router/view.php:116}() /libraries/cms/component/router/view.php:116
PHP  16. JComponentRouterViewInspector->getCategorySegment() /libraries/cms/component/router/view.php:116
PHP  17. JCategories->get() /libraries/cms/component/router/stubs/JComponentRouterViewInspector.php:59
PHP  18. JCategories->_load() /libraries/legacy/categories/categories.php:184
PHP  19. JFactory::getUser() /libraries/legacy/categories/categories.php:214
PHP  20. JSession->get() /libraries/joomla/factory.php:236
avatar photodude photodude - open - 24 Dec 2015
avatar creativeprogramming
creativeprogramming - comment - 24 Dec 2015

See here:

3.4.6...3.4.7#L430

in 3.4.6 it was:

     public function get($name, $default = null, $namespace = 'default')
     {
        //...omissis...
        if (isset($_SESSION[$namespace][$name]))
        {
            return $_SESSION[$namespace][$name];
        }
        return $default;
     }

in 3.4.7 is:

    public function get($name, $default = null, $namespace = 'default')
    {
        //...omissis...
        return $this->data->get($namespace . '.' . $name, $default);
    }

so, we are missing the isset() now, and as $this->data is not initialized, so we should do something like:

    public function get($name, $default = null, $namespace = 'default')
    {
        //...omissis...
           if ($this->data!=null)
           {
               return $this->data->get($namespace . '.' . $name, $default);
           }
           return $default;
    }

or initialize the $data property to Registry

protected $data = new \Joomla\Registry\Registry;

and then rely on the Registry->get() for the default value

avatar Fedik
Fedik - comment - 24 Dec 2015

there was fix already #8773 no?

avatar nikosdion
nikosdion - comment - 24 Dec 2015

Guys, it's already fixed #8773 A new version 3.4.8 will be released as soon as possible, as far as I'm told (I'm not in any official position, just helping in the 3.4.7 cleanup).

avatar brianteeman brianteeman - close - 24 Dec 2015
avatar wilsonge wilsonge - change - 24 Dec 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-12-24 11:35:06
Closed_By wilsonge
avatar wilsonge wilsonge - close - 24 Dec 2015
avatar wilsonge wilsonge - close - 24 Dec 2015
avatar photodude
photodude - comment - 25 Dec 2015

@wilsonge I disagree with closing this. This issue is specific to Travis-ci failing, until there is a PR merged in the staging branch that resolves that, IMO this should remain open. (secondary is the jenkins stability issue)

Consider that every PR based on the current staging branch will also fail in Travis-CI, this greatly slows down reviewing PR's in GitHub. It also makes people even more complacent to their PR's failing, and could even prevent people from noticing the issues in their PR's.

avatar wilsonge
wilsonge - comment - 26 Dec 2015

I've merged in 3.4.8 - travis now passes :)

avatar photodude
photodude - comment - 27 Dec 2015

Thanks @wilsonge Much better having a stable Travis-CI and Jenkins in the staging branch.

avatar brianteeman brianteeman - change - 8 Mar 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment