Fixed installation of option categories
authorMarcel Werk <burntime@woltlab.com>
Fri, 12 Apr 2013 18:54:12 +0000 (20:54 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 12 Apr 2013 18:54:12 +0000 (20:54 +0200)
wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php

index e9e42535348404f390230b70d4a5a81edad5be7a..ce422f22ad8e8bebe11517aa5e05b2fe814f3e7b 100644 (file)
@@ -210,10 +210,6 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                ));
                $row = $statement->fetchArray();
                if (empty($row['categoryID'])) {
-                       if ($row['categoryID'] != $this->installation->getPackageID()) {
-                               throw new SystemException("Cannot override existing category '".$category['categoryName']."'");
-                       }
-                       
                        // insert new category
                        $sql = "INSERT INTO     wcf".WCF_N."_".$this->tableName."_category
                                                (packageID, categoryName, parentCategoryName, permissions,
@@ -233,6 +229,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                        $statement->execute($data);
                }
                else {
+                       if ($row['categoryID'] != $this->installation->getPackageID()) {
+                               throw new SystemException("Cannot override existing category '".$category['categoryName']."'");
+                       }
+                       
                        // update existing category
                        $sql = "UPDATE  wcf".WCF_N."_".$this->tableName."_category
                                SET     parentCategoryName = ?,