Removed 'updateType' and replaced with 'isCritical'
authorAlexander Ebert <ebert@woltlab.com>
Tue, 15 Jan 2013 00:31:41 +0000 (01:31 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 15 Jan 2013 00:31:41 +0000 (01:31 +0100)
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php
wcfsetup/setup/db/install.sql

index dbc26ff7d19532572730e957855a8dacbb3eb1eb..5ee20f25afc95916b573991cfaabe90387bf5d6c 100644 (file)
@@ -186,13 +186,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                foreach ($elements as $element) {
                        $versionNo = $element->getAttribute('name');
                        $packageInfo['versions'][$versionNo] = array(
-                               'isAccessible' => true
+                               'isAccessible' => ($element->getAttribute('accessible') == 'true' ? true : false),
+                               'isCritical' => ($element->getAttribute('critical') == 'true' ? true : false)
                        );
                        
-                       if ($element->hasAttribute('accessible') && $element->getAttribute('accessible') == 'false') {
-                               $packageInfo['versions'][$versionNo]['accessible'] = false;
-                       }
-                       
                        $children = $xpath->query('child::*', $element);
                        foreach ($children as $child) {
                                switch ($child->tagName) {
@@ -203,10 +200,6 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                }
                                        break;
                                        
-                                       case 'updatetype':
-                                               $packageInfo['versions'][$versionNo]['updateType'] = $child->nodeValue;
-                                       break;
-                                       
                                        case 'timestamp':
                                                $packageInfo['versions'][$versionNo]['packageDate'] = $child->nodeValue;
                                        break;
@@ -350,10 +343,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                $versionEditor->update(array(
                                                        'filename' => $packageFile,
                                                        'isAccessible' => ($versionData['isAccessible'] ? 1 : 0),
+                                                       'isCritical' => ($versionData['isCritical'] ? 1 : 0),
                                                        'license' => (isset($versionData['license']['license']) ? $versionData['license']['license'] : ''),
                                                        'licenseURL' => (isset($versionData['license']['license']) ? $versionData['license']['licenseURL'] : ''),
-                                                       'packageDate' => $versionData['packageDate'],
-                                                       'updateType' => $versionData['updateType']
+                                                       'packageDate' => $versionData['packageDate']
                                                ));
                                        }
                                        else {
@@ -363,10 +356,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                        'license' => (isset($versionData['license']['license']) ? $versionData['license']['license'] : ''),
                                                        'licenseURL' => (isset($versionData['license']['license']) ? $versionData['license']['licenseURL'] : ''),
                                                        'isAccessible' => ($versionData['isAccessible'] ? 1 : 0),
+                                                       'isCritical' => ($versionData['isCritical'] ? 1 : 0),
                                                        'packageDate' => $versionData['packageDate'],
                                                        'packageUpdateID' => $packageUpdateID,
-                                                       'packageVersion' => $packageVersion,
-                                                       'updateType' => $versionData['updateType']
+                                                       'packageVersion' => $packageVersion
                                                ));
                                                
                                                $packageUpdateVersionID = $version->packageUpdateVersionID;
@@ -460,7 +453,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                (packageUpdateVersionID, package)
                                VALUES          (?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       foreach ($requirementInserts as $requirement) {
+                       foreach ($optionalInserts as $requirement) {
                                $statement->execute(array(
                                        $requirement['packageUpdateVersionID'],
                                        $requirement['package']
index ac4b08c4f00ddca41085e6cbec688a31b6bd6ff2..24eed0b6350e1789baf0dc32615e10552c8f57c4 100644 (file)
@@ -493,12 +493,12 @@ CREATE TABLE wcf1_package_update_version (
        packageUpdateVersionID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
        packageUpdateID INT(10) NOT NULL,
        packageVersion VARCHAR(50) NOT NULL DEFAULT '',
-       updateType VARCHAR(10) NOT NULL DEFAULT '',
        packageDate INT(10) NOT NULL DEFAULT 0,
        filename VARCHAR(255) NOT NULL DEFAULT '',
        license VARCHAR(255) NOT NULL DEFAULT '',
        licenseURL VARCHAR(255) NOT NULL DEFAULT '',
        isAccessible TINYINT(1) NOT NULL DEFAULT 1,
+       isCritical TINYINT(1) NOT NULL DEFAULT 0,
        UNIQUE KEY packageUpdateID (packageUpdateID, packageVersion)
 );