Actions

Difference between revisions of "Database-tab-error-in-2.5.10"

From Joomla! Documentation

(Change from 3.1.1 to 2.5.11)
 
(One intermediate revision by one user 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 3.1.1 rather than apply the hot fix.
+
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.
  
<code>
+
<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);
 
  }
 
  }
  </code>
+
  </source>
  
 
[[Category:Version 2.5.10 FAQ]]
 
[[Category:Version 2.5.10 FAQ]]

Latest revision as of 09:05, 30 September 2013

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);
        }