J3.x

Session Fatal Error in some CLI Scripts

From Joomla! Documentation

Revision as of 08:11, 9 April 2016 by Wilsonge (talk | contribs) (Created page with "Some CLI scripts started failing in Joomla 3.5.0 and higher ==Errors reported== Fatal error: Call to a member function get() on null in /libraries/joomla/session/handler/joom...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Some CLI scripts started failing in Joomla 3.5.0 and higher

Errors reported[edit]

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

Versions affected[edit]

Info non-talk.png
General Information

This pertains only to Joomla! version(s):- 3.5.0 and higher


What is the cause[edit]

A mass refactoring of the session library in Joomla 3.5.0 for future stability broke some old CLI scripts

How to fix[edit]

Ensure that you call the session initialise method with:

$session->initialise()

ensuring that the first parameter is a JInput object (which should be retrievable from the application or you can create a new one). For more information please read the method documentation at https://github.com/joomla/joomla-cms/blob/3.5.0/libraries/joomla/session/session.php#L464