Broken Global Configuration On Upgrade to 3.0

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Wed Oct 10, 2012 6:10 am

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.
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

danscott
Joomla! Intern
Joomla! Intern
Posts: 68
Joined: Tue Aug 14, 2007 9:51 pm
Contact:

Re: Broken Global Configuration On Upgrade to 3.0

Post by danscott » Wed Oct 10, 2012 11:36 am

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

alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Re: Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Wed Oct 10, 2012 5:25 pm

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)
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

danscott
Joomla! Intern
Joomla! Intern
Posts: 68
Joined: Tue Aug 14, 2007 9:51 pm
Contact:

Re: Broken Global Configuration On Upgrade to 3.0

Post by danscott » Wed Oct 10, 2012 6:25 pm

Excellent, thanks. I'll try this tonight.

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

alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Re: Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Wed Oct 10, 2012 6:49 pm

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.
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

danscott
Joomla! Intern
Joomla! Intern
Posts: 68
Joined: Tue Aug 14, 2007 9:51 pm
Contact:

Re: Broken Global Configuration On Upgrade to 3.0

Post by danscott » Thu Oct 11, 2012 1:28 pm

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

alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Re: Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Thu Oct 11, 2012 6:46 pm

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.
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: Broken Global Configuration On Upgrade to 3.0

Post by humvee » Wed Oct 17, 2012 6:14 pm

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

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Broken Global Configuration On Upgrade to 3.0

Post by mcsmom » Thu Oct 18, 2012 2:37 am

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?
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Re: Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Thu Oct 18, 2012 5:04 am

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?
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Broken Global Configuration On Upgrade to 3.0

Post by mcsmom » Thu Oct 18, 2012 10:13 am

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?
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Broken Global Configuration On Upgrade to 3.0

Post by mcsmom » Thu Oct 18, 2012 1:59 pm

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?
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44088
Joined: Sat Apr 05, 2008 9:58 pm

Re: Broken Global Configuration On Upgrade to 3.0

Post by Webdongle » Thu Oct 18, 2012 5:41 pm

@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 ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Re: Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Fri Oct 19, 2012 1:40 pm

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.
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Re: Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Fri Oct 19, 2012 1:45 pm

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.
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

alwarren
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Fri Aug 19, 2005 9:27 am

Re: Broken Global Configuration On Upgrade to 3.0

Post by alwarren » Fri Oct 19, 2012 3:38 pm

Further comments on my part will be in the bug squad Google group here - https://groups.google.com/d/topic/jooml ... discussion
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW

benmillerj
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Wed Aug 24, 2011 9:59 pm

Re: Broken Global Configuration On Upgrade to 3.0

Post by benmillerj » Mon Nov 19, 2012 11:54 pm

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


Locked

Return to “Joomla! 3.x Bug Reporting”