Fixed wrong package dir in style export
authorMarcel Werk <burntime@woltlab.com>
Wed, 11 Feb 2015 12:57:11 +0000 (13:57 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 11 Feb 2015 12:57:11 +0000 (13:57 +0100)
wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index 3ac6e08bc125b599990ce65ef3ba6b83f2e8185e..e4b0f9183f72cdd6cd0aa618e60298758e335792 100644 (file)
@@ -665,15 +665,17 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                        $statement->execute(array($this->templateGroupID));
                        while ($row = $statement->fetchArray()) {
                                $packageDir = 'com.woltlab.wcf';
+                               $package = null;
                                
                                if ($row['application'] != 'wcf') {
                                        $application = ApplicationHandler::getInstance()->getApplication($row['application']);
-                                       $packageDir = $row['package'];
+                                       $package = PackageCache::getInstance()->getPackage($application->packageID);
+                                       $packageDir = $package->package;
                                }
                                else {
                                        $application = ApplicationHandler::getInstance()->getWCF();
+                                       $package = PackageCache::getInstance()->getPackage($application->packageID);
                                }
-                               $package = PackageCache::getInstance()->getPackage($application->packageID);
                                
                                $filename = FileUtil::addTrailingSlash(FileUtil::getRealPath(WCF_DIR . $package->packageDir . 'templates/' . $templateGroup->templateGroupFolderName)) . $row['templateName'] . '.tpl';
                                $templatesTar->add($filename, $packageDir, dirname($filename));