Page 1 of 1

Broken Global Configuration On Upgrade to 3.0

Posted: Wed Oct 10, 2012 6:10 am
by alwarren
I followed the upgrade instructions on a development server to upgrade from 2.5 to 3.0 (before 3.0.1 was released). All previously installed plugins and modules were disabled. When I tried to go to Global Configuration, the page was incomplete. Upon further investigation, I discovered that there was a 500 server error with the message SQL=SELECT id FROM #__assets WHERE alias = 'root'.

In a nutshell, JTableAsset extends JTableNested. JTableNested has an alias property so property_exists('alias') evaluates true in getRootId(). But, #__asset doesn't have an alias column which causes a MySQL error.

This is a trace of what I found:
  1. libraries/joomla/form/fields/rules.php calls JAccess::checkGroup($group->value, 'core.admin') at line 219
  2. libraries/joomla/access/access.php calls JTable::getInstance('Asset', 'JTable', array('dbo' => $db)) at line 145
  3. followed by $assets->getRootId() at line 146
  4. libraries/joomla/table/nested.php checks if (property_exists($this, 'alias')) at line 1164
  5. followed by $this->_db->setQuery($query)->loadColumn(); at line 1172
  6. which attempts to execute SQL=SELECT id FROM #__assets WHERE alias = 'root' which throws a 500 server error
  7. column alias does not exist in table #__assets
I upgraded to 3.0.1 and there was no change. I have no idea if this has been posted anywhere. I checked the source on Github and the files and line numbers still matched.

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Wed Oct 10, 2012 11:36 am
by danscott
Hi,

I have upgraded my dev site to 3.0.1 and have found the same problem.

I tried the 'fix database' utility, but it reported that I am up-to-date.

Anyone have a solution? I can create the column, but I'm not sure what the correct data type/contents should be.

Thanks,

Dan

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Wed Oct 10, 2012 5:25 pm
by alwarren
I've found a workaround that seems to fix the problem. This is only a temporary fix and you'll have to hack a core file which, normally, we don't do.

Note: It only works on instantiated objects.

Edit libraries/joomla/table/nested.php. Around line 1164, look for this:

Code: Select all

		if (property_exists($this, 'alias'))
And replace it with this:

Code: Select all

		// workaround for missing alias column in #__assets
		$skip = false;
		if(isset($this))
		{
			if (get_class($this) == 'JTableAsset')
			{
				$skip = true;
			}
		}
		if (property_exists($this, 'alias') && $skip !== true)

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Wed Oct 10, 2012 6:25 pm
by danscott
Excellent, thanks. I'll try this tonight.

Do you know what the column is for? And what data it should be populated with?

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Wed Oct 10, 2012 6:49 pm
by alwarren
The column is not used in #__assets. It doesn't exist in this or previous versions. The JTableNested parent class seems to be for working with nested records such as categories which does have use the alias column. That's part of the SEO I think. But, in my opinion, the alias property should be in the child class instead of the parent class as it's not really related to nesting.

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Thu Oct 11, 2012 1:28 pm
by danscott
This fixed the problem for me, thanks.

Do you think this is the correct way to fix the problem? We should maybe submit a bug.

I wonder why it's not a problem for everyone?

Dan

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Thu Oct 11, 2012 6:46 pm
by alwarren
My workaround is absolutely not the correct way to fix this. I still think the proper fix is to move the alias column to the child table class. It's not going to be a simple solution as it's going to affect either multiple classes or multiple db schemas.

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Wed Oct 17, 2012 6:14 pm
by humvee
As I am concerned that this issue or more specifically the solution within this thread is being "recommended" elsewhere in addition to having moved the thread to the Bug Squad Forum I have also now reported it to the Bug Squad Google Group https://groups.google.com/d/topic/jooml ... discussion

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Thu Oct 18, 2012 2:37 am
by mcsmom
What's happening is that it is attempting to save in assets when it shoudl be saving in the other table.

Is this in global configuration for both of you?

Does it happen any where else?

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Thu Oct 18, 2012 5:04 am
by alwarren
mcsmom wrote:What's happening is that it is attempting to save in assets when it shoudl be saving in the other table.

Is this in global configuration for both of you?

Does it happen any where else?
I saw it a couple other places but can't remember where. I just happened to debug global configuration because it made it unusable. And, no, it's not, as you say, trying to save in that "other table". It's simply dying before the page finishes loading. By the way, what other table are you referring to?

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Thu Oct 18, 2012 10:13 am
by mcsmom
Saving in assets only ever occurs in the context of saving somewhere else in this case #__extensions.


By any chance were these upgraded 1.5 sites?

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Thu Oct 18, 2012 1:59 pm
by mcsmom
Al what do you mean by "All previously installed plugins and modules were disabled." ?
Also in what way was global configuration "incomplete"? Was it not rendering completely? Missing tabs?

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Thu Oct 18, 2012 5:41 pm
by Webdongle
@alwarren

In addition to answering the questions can you please describe how you upgraded to 3.0. Was it via the Joomla update component or via the extension manager install ? Or did you try some other way ?

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Fri Oct 19, 2012 1:40 pm
by alwarren
mcsmom wrote:Saving in assets only ever occurs in the context of saving somewhere else in this case #__extensions.


By any chance were these upgraded 1.5 sites?
Again, this was not saving. This was simply loading the Global Configuration page.

I don't know what you mean by upgraded 1.5 sites. The installation has been around since 1.0. It's been through every upgrade up to and including 2.5 with no issues.

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Fri Oct 19, 2012 1:45 pm
by alwarren
Webdongle wrote:@alwarren

In addition to answering the questions can you please describe how you upgraded to 3.0. Was it via the Joomla update component or via the extension manager install ? Or did you try some other way ?
I followed the official upgrade instructions. Exactly.

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Fri Oct 19, 2012 3:38 pm
by alwarren
Further comments on my part will be in the bug squad Google group here - https://groups.google.com/d/topic/jooml ... discussion

Re: Broken Global Configuration On Upgrade to 3.0

Posted: Mon Nov 19, 2012 11:54 pm
by benmillerj
I'm upgrading some old sites to 3.x for testing purposes and ran across this post. Joomla 3.0.2 still has this problem, but if you pull the latest code off of GitHub (again, for testing purposes only), it is fixed. The latest version of nested.php has the following code, which takes care of the work around suggested elsewhere in this thread:

Code: Select all

		$fields = $this->getFields();	

		if (array_key_exists('alias', $fields))
		{
				...
This resolves the problem. I suggest this as the temporary fix for those who want to test 3.0.x