No Code Attached Yet
avatar PhilETaylor
PhilETaylor
24 May 2021

On code review it appears that the deprecated protected method createSession in the \Joomla\CMS\Factory abstract class is referencing a non existing class \JSessionHandlerJoomla and will therefore PHP Fatal error if anyone attempts to call this method.

This method is not used by Joomla and is already marked as deprecated for removal in 5.0 but as such it should remain working until then - and not creating fatal errors.

$sessionHandler = new \JSessionHandlerJoomla($options);

avatar PhilETaylor PhilETaylor - open - 24 May 2021
avatar joomla-cms-bot joomla-cms-bot - change - 24 May 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 May 2021
avatar PhilETaylor PhilETaylor - change - 24 May 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 24 May 2021
avatar PhilETaylor PhilETaylor - change - 24 May 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 24 May 2021
avatar eopws
eopws - comment - 24 May 2021

Then the $sessionHandler variable is used to get an instance of a Session class
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Factory.php#L621

It's done by call to the getInstance() method, which has no arguments at all (https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Session/Session.php#L160-L170).

avatar PhilETaylor
PhilETaylor - comment - 15 Aug 2021

This issue remains today. This class doesnt exist! this is the only reference to "JSessionHandlerJoomla" in the whole codebase.

@wilsonge please review

avatar wilsonge
wilsonge - comment - 15 Aug 2021

So I guess we just remove createSession as it's totally unused? As the session is now injected into the Application. It is protected so technically it's a b/c break to those subclassing Factory. But it's one of those things where practically it's not going to affect anyone. Especially as there's no real way to easily make this work.

avatar PhilETaylor
PhilETaylor - comment - 16 Aug 2021

PR #35146

avatar PhilETaylor PhilETaylor - change - 16 Aug 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-08-16 07:54:49
Closed_By PhilETaylor
Labels Added: No Code Attached Yet
Removed: ?
avatar PhilETaylor PhilETaylor - close - 16 Aug 2021

Add a Comment

Login with GitHub to post a comment