Actions

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

From Joomla! Documentation

(Created page with " 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 cann...")
 
(Change from 3.1.1 to 2.5.11)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.   
+
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.
+
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.
  
 
+
<source lang="php">
 
+
diff --git a/libraries/cms/schema/changeset.php b/libraries/cms/schema/changeset.php
<code>
+
index 95b1a47..8e0ba28 100644
diff --git a/libraries/cms/schema/changeset.php b/libraries/cms/schema/changeset.php
+
--- a/libraries/cms/schema/changeset.php
index 95b1a47..8e0ba28 100644
+
+++ b/libraries/cms/schema/changeset.php
--- a/libraries/cms/schema/changeset.php
+
@@ -196,7 +196,8 @@
+++ b/libraries/cms/schema/changeset.php
+
@@ -196,7 +196,8 @@
+
 
  {
 
  {
 
  $this->folder = JPATH_ADMINISTRATOR . '/components/com_admin/sql/updates/';
 
  $this->folder = JPATH_ADMINISTRATOR . '/components/com_admin/sql/updates/';
Line 21: Line 19:
 
   
 
   
 
  /**
 
  /**
diff --git a/libraries/joomla/filesystem/folder.php b/libraries/joomla/filesystem/folder.php
+
diff --git a/libraries/joomla/filesystem/folder.php b/libraries/joomla/filesystem/folder.php
index edf39d6..ecabc52 100644
+
index edf39d6..ecabc52 100644
--- a/libraries/joomla/filesystem/folder.php
+
--- a/libraries/joomla/filesystem/folder.php
+++ b/libraries/joomla/filesystem/folder.php
+
+++ b/libraries/joomla/filesystem/folder.php
@@ -467,13 +467,14 @@
+
@@ -467,13 +467,14 @@
 
  * @param  boolean  $full          True to return the full path to the file.
 
  * @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    $exclude        Array with names of files which should not be shown in the result.
Line 36: Line 34:
 
  */
 
  */
 
  public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
 
  public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
- $excludefilter = array('^\..*', '.*~'))
+
  - $excludefilter = array('^\..*', '.*~'))
 
  + $excludefilter = array('^\..*', '.*~'), $naturalSort = false)
 
  + $excludefilter = array('^\..*', '.*~'), $naturalSort = false)
 
  {
 
  {
 
  // Check to make sure the path valid and clean
 
  // Check to make sure the path valid and clean
 
  $path = JPath::clean($path);
 
  $path = JPath::clean($path);
@@ -498,8 +499,15 @@
+
@@ -498,8 +499,15 @@
 
  // Get the files
 
  // Get the files
 
  $arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, true);
 
  $arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, true);
Line 58: 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);
        }