? Error

User tests: Successful: Unsuccessful:

avatar nikosdion
nikosdion
14 Nov 2013

Overview

Important: See Joomla! Tracker item 32715

This PR fixes two issues with the post-upgrade script (JoomlaInstallerScript) that have been the root cause of bus reported in the Joomla! forum:

  • Post-installation Messages component causing errors after upgrade
  • The updateAssets() method causing a Fatal Error

Technical analysis

Post-installation Messages component errors

The most common symptoms are one of the following messages:

  • An error has occurred. 0 SQL=SHOW FULL COLUMNS FROM abcd_postinstall_cpanels
  • Call to a member function getInt() on a non-object in .../administrator/components/com_postinstall/models/messages.php on line 37

These errors have actually nothing to do with the code we include in Joomla! 3.2. These errors occur when the user has installed a very old version of FOF (1.x) in his site, most likely as the result of installing a very old version of a FOF-powered component in a Joomla! 2.5 site. FOF 1.x was never compatible with Joomla! 3, therefore the site must be upgraded from Joomla! 1.6, 1.7 or 2.5 for this error to occur.

The problem is that FOF 1.x had a flat layout, each one of its classes being a single file in the root of the libraries/fof directory. FOF 2.x moved to a PSR-0 scheme, just like Joomla! Platform, with each class file being in a package in its own sub-directory inside the libraries/fof directory. The FOF autoloader supports both conventions and always loads the legacy libraries first. The solution employed by FOF 2.x components is to remove the FOF 1.x files upon installation. This is not done when upgrading to Joomla! 3.2 as the code to do that was missing from JoomlaInstallerScript. This PR adds the missing lines to prevent this error condition.

Note: FOF is the framework selected as the Joomla! RAD Layer. The two names are used interchangeably.

The updateAssets() method causing a Fatal Error

The updateAssets() method was referencing the $db object in the final if-block which is supposed to perform roll-back in case of a failed update. However, the $db object wasn't defined in the scope of the method, leading to a fatal error.

To the best of my knowledge nobody reported it, presumably because a failed installation causes more grave issues than a fatal error. It was an easy fix, so here you have it.

Further information

Backwards compatibility issues

None. This PR does not affect the public API and doesn't even include any code. It merely enumerates the files to be deleted and defines the missing variable.

Developer information

None. This PR does not affect the public API.

Testing instructions

Due to the conditions leading to this issue it is a far cry providing test instructions without referencing my own software, usually considered a cardinal sin in this project, but there you have it anyway.

One could follow this procedure to reproduce the issue:

One could follow this procedure to reproduce the fix:

  • Create a new Joomla! 2.5 site
  • Install []Admin Tools Core 2.2.10](https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html)
  • Uninstall Admin Tools Core. This leaves behind the old version of FOF in libraries/fof
  • Upgrade to Joomla! 3.2, replacing the administrator/components/com_admin/script.php file of the upgrade package with the one from this PR
  • You will not receive any of the aforementioned error messages

I know that testing it is very hard. Sorry, folks, we have not yet been able to provide simple test instructions for issues affecting the post-update script :(

avatar nikosdion nikosdion - open - 14 Nov 2013
avatar Bakual
Bakual - comment - 15 Nov 2013

I tried to reproduce the issue (using Joomla Updater) but I get a different error:
update_error
on URL http://localhost/joomla2.5/administrator/index.php?option=com_joomlaupdate&task=update.finalise

It shows that error both in front- and backend.

Disabling the admintools plugin in the database fixes the frontend but brings then another fatal error in the backend:
fatal_error
Probably because the update failed during the finalise step.

So either the test instructions to reproduce this issue are wrong or I do something wrong.

But then this issue isn't really a Joomla issue anyway. It's caused by the user who didn't make sure the installed extensions are compatible with Joomla 3.2 prior to the update. This is a mandatory step when going between major versions and there is no excuse for not checking that prior to hitting that funny update button.

avatar nikosdion
nikosdion - comment - 15 Nov 2013

The error message you got has to do with that old version of Admin Tools not being compatible with Joomla! 3. I forgot to say that you need to disable that plugin before upgrade. Sorry!

The fatal error in the backend comes from the post-installation script not running because of the error you got when the update.finalise task was called and never run. The correct test instructions are:

  • Create a new Joomla! 2.5 site
  • Install Admin Tools Core 2.2.10
  • Uninstall Admin Tools Core. This leaves behind the old version of FOF in libraries/fof
  • Upgrade to Joomla! 3.2
  • You will get one of the aforementioned error messages
avatar Bakual
Bakual - comment - 15 Nov 2013

Still don't get the error you see:
fatal_error2
This may be due to different server settings.
Removing the old FoF files manually solves that issue. Installing the current version of AdminTools solves this issue as well (as it apparently also does the cleanup).

On a sidenote: I was surprised that FoF didn't show up in the extension manager. If it did, users could uninstall it properly prior to the update. Later versions show up like expected. So I guess this is an issue with FoF v1.

So basically we have an issue with a very old version of an external framework which can't be uninstalled properly. And we have to fix it because we now have a properly coded successor version of FoF in core. Sounds a bit wrong but I guess since it's easy to do and helps the user we can do it anyway.

Another approach as I understand it would be to change the FoF autoloader so it doesn't load the legacy classes first in Joomla 3.x. Since those classes aren't compatible with Joomla 3.x anyway it doesn't make much sense to try loading them at all. I guess it's needed for B/C reasons in Joomla 2.5?

Can you update the test instructions in the tracker and in the initial post here as well? Otherwise testers will have a hard time reproduce the issue.

avatar nikosdion
nikosdion - comment - 15 Nov 2013

As I said, the error messages I pasted above are some of the common ones. Depending on what is running on your site, in which order, etc it may cause different error messages. If it has to do with com_postinstall or an FOF class name it's this issue.

FOF 1.x wasn't a library package on purpose. Back then we had to support Joomla! 1.5 and 1.7/2.5 in a single package. The only way to do that was to shovel files in the libraries directory.

Changing the FOF autoloader would break b/c. I'm not sure if anyone uses that feature, but I don't want to find out by braking b/c in a sub-minor version upgrade. I try to follow semantic versioning with FOF. I will change the autoloader for FOF 3 but not anytime sooner. I'll update the instructions right now.

avatar Bakual
Bakual - comment - 15 Nov 2013

Thanks for updating the instructions.

avatar infograf768
infograf768 - comment - 16 Nov 2013

@test
It did not delete the said files here. I started from a 2.5.16 and used the extension manager Install with an update pack containing the patched script
I get
Fatal error: Class FOFController cannot extend from interface JController in /Applications/MAMP/htdocs/Joomla_2.5.14-Stable-Full_Package/libraries/fof/controller.php on line 23

and indeed the files are still present in the library

avatar line49
line49 - comment - 14 Jan 2014

Hi,

I upgraded a site and am now getting this error in the admin backend:
Fatal error: Class FOFModel cannot extend from interface JModel in /home//public_html/libraries/fof/model.php on line 21

What do I do to fix this?

avatar nikosdion
nikosdion - comment - 14 Jan 2014

You have tried to install a very old FOF-based component which was designed for Joomla! 1.5 only. This screwed up your installation. You should be able to easily fix it by doing the following steps in the order specified:

  • Delete the libraries/fof directory from your site
  • Download FOF 2.1.1
  • Extract the ZIP file locally
  • Upload the fof directory you extracted into your site's libraries directory Assuming that the older component you installed isn't using a private copy of FOF 1.x and loading it via a plugin you should get access to your site. Otherwise you will have to determine which plugin is trying to load the very old FOF version and delete it from your site.
avatar line49
line49 - comment - 14 Jan 2014
Hi Nicholas,
  Thank you very much for your help! This has gotten the backend of
  the site back for us. I had a forum post about the problem, so
  have added your fix for anyone else that is having the issue.
  As far as I know we have all Joomla 2.5 and 3.x extensions
  installed. Is there any easy way to figure out what extension used
  the old FOF library?
  Thank you again so much for your help, it is really appreciated.
    Laurelle 
avatar Webdongle
Webdongle - comment - 14 Jan 2014

You could check that all your 3rd party extensions are up to date ?

avatar cecebar
cecebar - comment - 18 Jan 2014

Thank you Nicholas. Replacing FOF libraries fixed the upgrade issue. Got my control panel back.
_Cindy

avatar uspot
uspot - comment - 18 Jan 2014

Hi,

I'm also experiencing this problem with the following error "Class FOFModel cannot extend from interface JModel in E:\wamp\www\site1\libraries\fof\model.php on line 21"

In my case this error only appears in ""administrator/index.php", if I type "administrator/index.php?option=com_installer&view=manage" in browsers address bar, I can use administrator panel without problems, but every time I access "administrator/index.php'' this error appears.

After updating from joomla 2.5.17 to Joomla 3.2.1, I checked fof version, it was 2.1.1. But I tried above mentioned fix anyway, sadly it didn't help me. I also tried deleting fof directory entirely, but that brought a whole new set of errors.

I didn't have any old components or plugins, in fact, I deleted everything not compatible with Joomla 3 and updated everything that is compatible with Joomla3 and I didn't event have that much components/plugins.

I have a backup so I could try to update again, but could you please suggest what to do in order to succeed? If I would update fof to 2.1.1 before updating Joomla to 3.2.1 would it help to avoid this error?
I also tried disabling every plugin and disabling every unprotected component, sadly this also didn't help.

avatar jgo
jgo - comment - 19 Jan 2014

Thank you nikosdion - replaced fof and the backend blank page has gone. :+1:

avatar uspot
uspot - comment - 19 Jan 2014

I didn't delete libraries/fof folder before. I just replaced it. I tried deleting it first and the replacing it, that helped.

Thank you!

avatar nikosdion nikosdion - change - 16 Jun 2014
Description <h1>Overview</h1> <p><strong>Important</strong>: See Joomla! Tracker item <a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=32715">32715</a></p> <p>This PR fixes two issues with the post-upgrade script (JoomlaInstallerScript) that have been the root cause of bus reported in the Joomla! forum:</p> <ul> <li>Post-installation Messages component causing errors after upgrade</li> <li>The updateAssets() method causing a Fatal Error</li> </ul><h1>Technical analysis</h1> <h2>Post-installation Messages component errors</h2> <p>The most common symptoms are one of the following messages:</p> <ul> <li><code>An error has occurred. 0 SQL=SHOW FULL COLUMNS FROM abcd_postinstall_cpanels</code></li> <li>Call to a member function getInt() on a non-object in .../administrator/components/com_postinstall/models/messages.php on line 37</li> </ul><p>These errors have actually nothing to do with the code we include in Joomla! 3.2. These errors occur when the user has installed a very old version of FOF (1.x) in his site, most likely as the result of installing a very old version of a FOF-powered component in a Joomla! 2.5 site. FOF 1.x was never compatible with Joomla! 3, therefore the site must be upgraded from Joomla! 1.6, 1.7 or 2.5 for this error to occur.</p> <p>The problem is that FOF 1.x had a flat layout, each one of its classes being a single file in the root of the libraries/fof directory. FOF 2.x moved to a PSR-0 scheme, just like Joomla! Platform, with each class file being in a package in its own sub-directory inside the libraries/fof directory. The FOF autoloader supports both conventions and always loads the legacy libraries first. The solution employed by FOF 2.x components is to remove the FOF 1.x files upon installation. This is not done when upgrading to Joomla! 3.2 as the code to do that was missing from JoomlaInstallerScript. This PR adds the missing lines to prevent this error condition.</p> <p>Note: FOF is the framework selected as the Joomla! RAD Layer. The two names are used interchangeably.</p> <h2>The updateAssets() method causing a Fatal Error</h2> <p>The updateAssets() method was referencing the $db object in the final if-block which is supposed to perform roll-back in case of a failed update. However, the $db object wasn't defined in the scope of the method, leading to a fatal error.</p> <p>To the best of my knowledge nobody reported it, presumably because a failed installation causes more grave issues than a fatal error. It was an easy fix, so here you have it.</p> <h1>Further information</h1> <h2>Backwards compatibility issues</h2> <p><strong>None</strong>. This PR does not affect the public API and doesn't even include any code. It merely enumerates the files to be deleted and defines the missing variable.</p> <h2>Developer information</h2> <p><strong>None</strong>. This PR does not affect the public API.</p> <h2>Testing instructions</h2> <p>Due to the conditions leading to this issue it is a far cry providing test instructions without referencing my own software, usually considered a cardinal sin in this project, but there you have it anyway.</p> <p>One could follow this procedure to reproduce the issue:</p> <ul> <li>Create a new Joomla! <strong>2.5</strong> site</li> <li>Install []Admin Tools Core 2.2.10](<a href="https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html">https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html</a>)</li> <li>Uninstall Admin Tools Core. This leaves behind the old version of FOF in libraries/fof</li> <li>Upgrade to Joomla! 3.2</li> <li>You will get one of the aforementioned error messages</li> </ul><p>One could follow this procedure to reproduce the fix:</p> <ul> <li>Create a new Joomla! <strong>2.5</strong> site</li> <li>Install []Admin Tools Core 2.2.10](<a href="https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html">https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html</a>)</li> <li>Uninstall Admin Tools Core. This leaves behind the old version of FOF in libraries/fof</li> <li>Upgrade to Joomla! 3.2, replacing the administrator/components/com_admin/script.php file of the upgrade package with the one from this PR</li> <li>You will not receive any of the aforementioned error messages</li> </ul><p>I know that testing it is very hard. Sorry, folks, we have not yet been able to provide simple test instructions for issues affecting the post-update script :(</p> <h1>Overview</h1> <p><strong>Important</strong>: See Joomla! Tracker item <a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=32715">32715</a></p> <p>This PR fixes two issues with the post-upgrade script (JoomlaInstallerScript) that have been the root cause of bus reported in the Joomla! forum:</p> <ul class="task-list"> <li>Post-installation Messages component causing errors after upgrade</li> <li>The updateAssets() method causing a Fatal Error</li> </ul><h1>Technical analysis</h1> <h2>Post-installation Messages component errors</h2> <p>The most common symptoms are one of the following messages:</p> <ul class="task-list"> <li><code>An error has occurred. 0 SQL=SHOW FULL COLUMNS FROM abcd_postinstall_cpanels</code></li> <li>Call to a member function getInt() on a non-object in .../administrator/components/com_postinstall/models/messages.php on line 37</li> </ul><p>These errors have actually nothing to do with the code we include in Joomla! 3.2. These errors occur when the user has installed a very old version of FOF (1.x) in his site, most likely as the result of installing a very old version of a FOF-powered component in a Joomla! 2.5 site. FOF 1.x was never compatible with Joomla! 3, therefore the site must be upgraded from Joomla! 1.6, 1.7 or 2.5 for this error to occur.</p> <p>The problem is that FOF 1.x had a flat layout, each one of its classes being a single file in the root of the libraries/fof directory. FOF 2.x moved to a PSR-0 scheme, just like Joomla! Platform, with each class file being in a package in its own sub-directory inside the libraries/fof directory. The FOF autoloader supports both conventions and always loads the legacy libraries first. The solution employed by FOF 2.x components is to remove the FOF 1.x files upon installation. This is not done when upgrading to Joomla! 3.2 as the code to do that was missing from JoomlaInstallerScript. This PR adds the missing lines to prevent this error condition.</p> <p>Note: FOF is the framework selected as the Joomla! RAD Layer. The two names are used interchangeably.</p> <h2>The updateAssets() method causing a Fatal Error</h2> <p>The updateAssets() method was referencing the $db object in the final if-block which is supposed to perform roll-back in case of a failed update. However, the $db object wasn't defined in the scope of the method, leading to a fatal error.</p> <p>To the best of my knowledge nobody reported it, presumably because a failed installation causes more grave issues than a fatal error. It was an easy fix, so here you have it.</p> <h1>Further information</h1> <h2>Backwards compatibility issues</h2> <p><strong>None</strong>. This PR does not affect the public API and doesn't even include any code. It merely enumerates the files to be deleted and defines the missing variable.</p> <h2>Developer information</h2> <p><strong>None</strong>. This PR does not affect the public API.</p> <h2>Testing instructions</h2> <p>Due to the conditions leading to this issue it is a far cry providing test instructions without referencing my own software, usually considered a cardinal sin in this project, but there you have it anyway.</p> <p>One could follow this procedure to reproduce the issue:</p> <ul class="task-list"> <li>Create a new Joomla! <strong>2.5</strong> site</li> <li>Install []Admin Tools Core 2.2.10](<a href="https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html">https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html</a>)</li> <li>Uninstall Admin Tools Core. This leaves behind the old version of FOF in libraries/fof</li> <li>Upgrade to Joomla! 3.2</li> <li>You will get one of the aforementioned error messages</li> </ul><p>One could follow this procedure to reproduce the fix:</p> <ul class="task-list"> <li>Create a new Joomla! <strong>2.5</strong> site</li> <li>Install []Admin Tools Core 2.2.10](<a href="https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html">https://www.akeebabackup.com/download/admintools/admintools-2-2-10.html</a>)</li> <li>Uninstall Admin Tools Core. This leaves behind the old version of FOF in libraries/fof</li> <li>Upgrade to Joomla! 3.2, replacing the administrator/components/com_admin/script.php file of the upgrade package with the one from this PR</li> <li>You will not receive any of the aforementioned error messages</li> </ul><p>I know that testing it is very hard. Sorry, folks, we have not yet been able to provide simple test instructions for issues affecting the post-update script :(</p>
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-06-16 09:33:48
avatar nikosdion nikosdion - close - 16 Jun 2014
avatar makevalue
makevalue - comment - 17 Dec 2014

Nikosdion,

Thanks very much. The challenge with using Akeea across many hosts is that I am not quite sure what I will get out it. Still better than manual in most cases.

Steve

Add a Comment

Login with GitHub to post a comment