Fixed for package uninstallation
authorAlexander Ebert <ebert@woltlab.com>
Thu, 6 Dec 2012 16:17:46 +0000 (17:17 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 6 Dec 2012 16:17:46 +0000 (17:17 +0100)
wcfsetup/install/files/lib/data/style/StyleEditor.class.php
wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php
wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php

index c31e4f65cd588419d162c16a6515a0ce43eafe27..d845c8f87f1378368bf924b5a6679586955fe0af 100644 (file)
@@ -70,19 +70,13 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                parent::delete();
                
                // delete variables
-               $sql = "DELETE FROM     wcf".WCF_N."_style_variable
-                       WHERE           styleID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->styleID));
-               
-               // delete style to package
-               $sql = "DELETE FROM     wcf".WCF_N."_style_to_package
+               $sql = "DELETE FROM     wcf".WCF_N."_style_variable_value
                        WHERE           styleID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array($this->styleID));
                
                // delete style files
-               $files = @glob(WCF_DIR.'style/style-*-'.$this->styleID.'*.css');
+               $files = @glob(WCF_DIR.'style/style-'.$this->styleID.'*.css');
                if (is_array($files)) {
                        foreach ($files as $file) {
                                @unlink($file);
@@ -91,7 +85,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                
                // delete preview image
                if ($this->image) {
-                       @unlink(WCF_DIR.$this->image);
+                       @unlink(WCF_DIR.'images/'.$this->image);
                }
        }
        
index 9c001a45cca9e135e4774a4e8422eb4feaa88457..30140c629479b4a0747c7c86eda45356dabe837e 100644 (file)
@@ -47,7 +47,12 @@ class ApplicationHandler extends SingletonFactory {
         */
        public function getPrimaryApplication() {
                $packageID = ($this->cache['primary']) ?: PACKAGE_ID;
-               return $this->cache['application'][$packageID];
+               
+               if (isset($this->cache['application'][$packageID])) {
+                       return $this->cache['application'][$packageID];
+               }
+               
+               return $this->cache['wcf'];
        }
        
        /**
index 56e4be9c0b0cef240cc4a840665e38af00ccdcca..99db43192e5b4ff3b82f05c525ed5ed04164d482 100644 (file)
@@ -14,7 +14,6 @@ use wcf\system\setup\Uninstaller;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
 use wcf\util\HeaderUtil;
-use wcf\util\FileUtil;
 
 /**
  * Handles the whole uninstallation process.