Difference between revisions of "Database tab error in 2.5.10"
From Joomla! Documentation
m (Ceford moved page Database-tab-error-in-2.5.10 to J2.5:Database tab error in 2.5.10: Changed namespace to J2.5 from Main) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
If for some reason you cannot update to 2.5.11 you can apply the following hot fix that was added in that update. | If for some reason you cannot update to 2.5.11 you can apply the following hot fix that was added in that update. | ||
− | To apply open the two referenced files (libraries/cms/schema/changeset.php and libraries/joomla/filesystem/folder.php) and delete all of the lines that start with a minus sign and add all the lines that start with a plus sign. It is strongly preferable that you do the update to | + | To apply open the two referenced files (libraries/cms/schema/changeset.php and libraries/joomla/filesystem/folder.php) and delete all of the lines that start with a minus sign and add all the lines that start with a plus sign. It is strongly preferable that you do the update to 2.5.11 rather than apply the hot fix. |
− | < | + | <source lang="php"> |
diff --git a/libraries/cms/schema/changeset.php b/libraries/cms/schema/changeset.php | diff --git a/libraries/cms/schema/changeset.php b/libraries/cms/schema/changeset.php | ||
index 95b1a47..8e0ba28 100644 | index 95b1a47..8e0ba28 100644 | ||
Line 56: | Line 56: | ||
return array_values($arr); | return array_values($arr); | ||
} | } | ||
− | </ | + | </source> |
[[Category:Version 2.5.10 FAQ]] | [[Category:Version 2.5.10 FAQ]] |
Latest revision as of 08:39, 25 July 2022
The "J2.5" namespace is a namespace scheduled to be archived. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
In 2.5.10 you may see an error in the database tab saying you are not on the latest version. This is most easily fixed by updating to 2.5.11.
If for some reason you cannot update to 2.5.11 you can apply the following hot fix that was added in that update. To apply open the two referenced files (libraries/cms/schema/changeset.php and libraries/joomla/filesystem/folder.php) and delete all of the lines that start with a minus sign and add all the lines that start with a plus sign. It is strongly preferable that you do the update to 2.5.11 rather than apply the hot fix.
diff --git a/libraries/cms/schema/changeset.php b/libraries/cms/schema/changeset.php
index 95b1a47..8e0ba28 100644
--- a/libraries/cms/schema/changeset.php
+++ b/libraries/cms/schema/changeset.php
@@ -196,7 +196,8 @@
{
$this->folder = JPATH_ADMINISTRATOR . '/components/com_admin/sql/updates/';
}
- return JFolder::files($this->folder . '/' . $sqlFolder, '\.sql$', 1, true);
+ return JFolder::files($this->folder . '/' . $sqlFolder, '\.sql$', 1, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
+ array('^\..*', '.*~'), true);
}
/**
diff --git a/libraries/joomla/filesystem/folder.php b/libraries/joomla/filesystem/folder.php
index edf39d6..ecabc52 100644
--- a/libraries/joomla/filesystem/folder.php
+++ b/libraries/joomla/filesystem/folder.php
@@ -467,13 +467,14 @@
* @param boolean $full True to return the full path to the file.
* @param array $exclude Array with names of files which should not be shown in the result.
* @param array $excludefilter Array of filter to exclude
+ * @param boolean $naturalSort False for asort, true for natsort
*
* @return array Files in the given folder.
*
* @since 11.1
*/
public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
- $excludefilter = array('^\..*', '.*~'))
+ $excludefilter = array('^\..*', '.*~'), $naturalSort = false)
{
// Check to make sure the path valid and clean
$path = JPath::clean($path);
@@ -498,8 +499,15 @@
// Get the files
$arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, true);
- // Sort the files
- asort($arr);
+ // Sort the files based on either natural or alpha method
+ if ($naturalSort)
+ {
+ natsort($arr);
+ }
+ else
+ {
+ asort($arr);
+ }
return array_values($arr);
}