Summary

The Database tab gets the incorrect schema version from the files in the installation/sql folder. It should only look at the files for the current database type (for example, "mysql" or "sqlsrv"). At present, it looks at all of the files. This causes it to report the wrong schema.
Opened On:
24 Apr 2013, 12:37 by Amirol Ahmad
Closed On:
26 Apr 2013, 16:42
Status:
Fixed in SVN/GitHub

Filed Under

  • Database
  • First
  • Google Chrome 14
  • No Platform Implications
  • Second
  • Third

Responses

Posted on 24 Apr 2013, 13:29 by Constantin Romankiewicz
Confirmed.

After the update, I got one error, database schema was at 2.5.10, klicked "fix". Then, the previous error was gone, but the database schema was back at 2.5.9.
Posted on 24 Apr 2013, 13:33 by Constantin Romankiewicz
I'm setting priority for this one to "Medium High".
Posted on 24 Apr 2013, 13:56 by Troy Hall
doing 2 different sites using 1-click update I did not experience this behavior. Both updated cleanly ( one using admin tools one not ) and both reported proper version in schema.
the admin tools updated one DID momentarily flash yellow "error" box but proceeded on normally, and the straight core update method reported manifest error after updating ( see error.jpg ) but both show proper info in backend and in db.
going back to "update" & "database" shows no errors or versioning issues.
Posted on 24 Apr 2013, 14:41 by Constantin Romankiewicz
@Troy: Did you klick on "fix" in "extensions - database"? Before clicking on "fix", the schematic was correct on my site, too.
Posted on 25 Apr 2013, 6:18 by Ofer Cohen
I can confirm this bug.
After upgrading manually from 2.5.9 and database fix (decompress Joomla_2.5.x_to_2.5.10-Stable-Patch_Package.zip), it's still show you that "Warning: Database is not up to date!".
Try to clear cache and run the mysql update manually (only one line in administrator/components/com_admin/sql/updates/mysql/2.5.10.sql), but still the warning exists.
Posted on 25 Apr 2013, 7:03 by Viktor Vogel
See my explanation and fix for this problem: http://forum.joomla.org/viewtopic.php?f=9&t=800213#p3023743


All Joomla! 2.5.10 installations are concerned with this problem.
Posted on 25 Apr 2013, 11:05 by Jean-Marie Simonet
This code works here,

Here below are patches for both 2.5.10 and 3.1.0
Posted on 25 Apr 2013, 11:49 by Amirol Ahmad
Thanks @Jean.

Your tricks work for 2.5.9 - 2.5.10
Posted on 25 Apr 2013, 12:31 by Amirol Ahmad
Done making pull request to Github Joomla CMS

https://github.com/joomla/joomla-cms/pull/1048
Posted on 25 Apr 2013, 13:08 by Elin Waring
https://github.com/joomla/joomla-cms/pull/1049
https://github.com/joomla/joomla-cms/pull/1049.diff

Is for 2.5, please test and we'll use a cleaned up patch without 4 commits assuming it works as expected.
Posted on 25 Apr 2013, 13:34 by Elin Waring
Hi Amirol would you please update your pr to match what I did in mine (which is against the 2.5.x branch). Great work on this!
Posted on 25 Apr 2013, 14:19 by Amirol Ahmad
Hi Elin,

I've done making some changes to my PR. However to code given below have been tested and wrong:

$excludefilter = array('^\..*', '.*~'), $sortType = false)

so I change it to

$excludefilter = array('^\..*', '.*~'), $sortType = true)

Please review https://github.com/joomla/joomla-cms/pull/1048


Posted on 25 Apr 2013, 15:42 by Mark Dexter
I believe what we want to do is to have the default be for the old behvior. So this would be the default will be to use asort, not natsort. This is purely on the small chance that someone is using this method and depending on this exact behavior. So, instead, we will change where we are calling the files method to specify the new behavior. I'm attaching a patch for 2.5. Please test with file 30651-mbd-3-v25.diff. I'll post a 3.1 patch shortly. Thanks!
Posted on 25 Apr 2013, 15:46 by Mark Dexter
Sorry, file name slightly wrong. Please 2.5 using 30681-03-25x-mbd.patch. (And pardon the typos in my previous message!) Thanks.
Posted on 25 Apr 2013, 15:52 by Mark Dexter
Actually, the same 25x patch works for master as well. So please test both. For master, we just need to make sure the Database tab works correctly after the patch. Thanks.
Posted on 25 Apr 2013, 16:23 by Amirol Ahmad
@Mark

Done applying 30681-03-25x-mbd.patch for 2.5.x (2.5.10)

2 files edited:-

1. /libraries/cms/schema/changeset.php
2. /libraries/joomla/filesystem/folder.php

Still got an error when click on Fix button
Posted on 25 Apr 2013, 16:28 by Amirol Ahmad
My bad..

Ignore my above comment.

@Mark

Your code is right. Has been tested 30681-03-25x-mbd.patch for 2.5.x (2.5.10) and yes, no more error..

Great job
Posted on 25 Apr 2013, 20:27 by Elin Waring
the default should be for the old behavior which would be for that parameter to be false or null in terms of the test but it's fine to make it explicityly fals.

Let's make this rtc.
Posted on 26 Apr 2013, 2:11 by Jean-Marie Simonet
I suggest to also correct the issue in 3.x although we may not need it right now, in order not to forget.
Posted on 26 Apr 2013, 5:05 by Viktor Vogel
I would add the new parameter after the parameter $full and before the parameter $exclude, so you wouldn't need to assign the parameters $exclude and $excludefilter.

But otherwise the solution is good and solves the problem as well.

Regards
Posted on 26 Apr 2013, 5:07 by Viktor Vogel
Okay, then we should have to change all calls. Forget it! ;-)
Posted on 26 Apr 2013, 10:12 by Leo Lammerink
@ Elin: Test confirmed and patch working confirmed
@ Amirol: Great Job!
@ JM : I agree to patch and correct 3.x where applies as well
Posted on 26 Apr 2013, 10:55 by Mark Dexter
Fixed in 2.5.x. Thanks.
Posted on 26 Apr 2013, 16:42 by Mark Dexter
Fixed in master. Thanks!