From: Matthias Schmidt Date: Sun, 19 May 2013 13:42:06 +0000 (+0200) Subject: Fixes issues with templates X-Git-Tag: 2.0.0_Beta_1~151 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9e77c825bce6ec90d195bb5f5ef46dab29834fc;p=GitHub%2FWoltLab%2FWCF.git Fixes issues with templates --- diff --git a/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php index fe3918cee6..6e18e635e0 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php @@ -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( diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 0edb82df72..9901acc1f3 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -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']