?

Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
4 Aug 2015

This fixes #7620. Read on to see why no developer should ever debug configuration issues while sober in Joomla.

Summary

With the changes from #7173 JFactory::getDbo() is now called from the application constructor. In the install application, the configuration is not yet loaded into JFactory::$config so when this call is made, Joomla attempts to populate that too. The default path in JFactory::getConfig() doesn't align to the path that the CMS writes its configuration to, so the real configuration (which is available at the point the installer is at now) doesn't get loaded. Because of a string of very inconsistent and borderline crazy behaviors, this actually works OK in the site/admin apps because they preload JConfig so the class exists in the filesystem and JFactory is able to load it when the time comes. Hat tip to @wilsonge and his lost sanity chasing that one down. Since JFactory::getDbo() has been called and a default configuration object is now persisted into the factory, the factory now also includes a database object that can't connect to the database because it wasn't loaded with the right configuration.

The Fix

We have to reset the configuration and database objects in the factory to force it to recreate them with the correct data to get past this error, and that is changed in InstallationModelLanguages.

Other Changes

Because of #5088 being merged and it bringing a bit more strictness with session bootup, errors were getting tossed out because we were previously resetting JFactory::$session which is causing the session to be booted twice. I wish I could remember why that was happening, all I know is it was needed at some point. After fixing the database error, the language install UI appeared to be "hanging", but inspecting requests with the Chrome Dev Tools showed that PHP errors were getting thrown because we were basically booting the session twice and setting config values after a session had been started, a big no-no. So, unsetting the session from the factory is no longer performed too.

How to Test

Just run through the installer and make sure the darn thing works.

avatar mbabker mbabker - open - 4 Aug 2015
avatar mbabker mbabker - change - 4 Aug 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Aug 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 4 Aug 2015
Milestone Added:
avatar Kubik-Rubik
Kubik-Rubik - comment - 4 Aug 2015

Thank you for the great explanation and the fix, @mbabker. Works as described!

avatar Kubik-Rubik Kubik-Rubik - close - 4 Aug 2015
avatar Kubik-Rubik Kubik-Rubik - reference | 747ef99 - 4 Aug 15
avatar Kubik-Rubik Kubik-Rubik - merge - 4 Aug 2015
avatar Kubik-Rubik Kubik-Rubik - change - 4 Aug 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-08-04 13:25:06
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 4 Aug 2015
avatar zero-24 zero-24 - change - 4 Aug 2015
Category Installation
avatar zero-24 zero-24 - change - 4 Aug 2015
Easy No Yes
avatar mbabker mbabker - head_ref_deleted - 4 Aug 2015
avatar infograf768
infograf768 - comment - 4 Aug 2015

Test OK here. Issue solved.

Add a Comment

Login with GitHub to post a comment