Fixes issues with templates
authorMatthias Schmidt <gravatronics@live.com>
Sun, 19 May 2013 13:42:06 +0000 (15:42 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 19 May 2013 13:42:06 +0000 (15:42 +0200)
wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php
wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index fe3918cee617f3c7701a2bc8751715c70c179189..6e18e635e0d71d08bf70f3e4722a7d0dee83f27f 100644 (file)
@@ -183,7 +183,7 @@ class TemplateAddForm extends AbstractForm {
                parent::save();
                
                if (empty($this->application)) {
-                       $this->application = Package::getAbbreviation(PackageCache::getInstance()->getPackage($this->package));
+                       $this->application = Package::getAbbreviation(PackageCache::getInstance()->getPackage($this->packageID));
                }
                
                $this->objectAction = new TemplateAction(array(), 'create', array('data' => array(
index 0edb82df72e5d40312c8c9ca159e170a21ed6b46..9901acc1f313a6cae60eacbe6a794ba3b9f03c7c 100644 (file)
@@ -409,7 +409,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                        $statement->execute(array(
                                                $package,
                                                1
-                                               ));
+                                       ));
                                        while ($row = $statement->fetchArray()) {
                                                // get template path
                                                $templatesDir = FileUtil::addTrailingSlash(FileUtil::getRealPath(WCF_DIR.$row['packageDir']).'templates/'.$templateGroupFolderName);
@@ -425,6 +425,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                                        $templatesTar->extract($template['index'], $templatesDir.$template['filename']);
                                                        
                                                        TemplateEditor::create(array(
+                                                               'application' => Package::getAbbreviation($package),
                                                                'packageID' => $row['packageID'],
                                                                'templateName' => StringUtil::replace('.tpl', '', $template['filename']),
                                                                'templateGroupID' => $styleData['templateGroupID']