From: Matthias Schmidt Date: Sun, 19 May 2013 13:25:18 +0000 (+0200) Subject: Fixes issues with templates X-Git-Tag: 2.0.0_Beta_1~152 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e568316b7bac37e2e99b412565ca18ff38672b39;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 f1b3dbdcca..fe3918cee6 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php @@ -1,5 +1,7 @@ application = $this->copiedTemplate->application; $this->packageID = $this->copiedTemplate->packageID; } } @@ -173,7 +182,12 @@ class TemplateAddForm extends AbstractForm { public function save() { parent::save(); + if (empty($this->application)) { + $this->application = Package::getAbbreviation(PackageCache::getInstance()->getPackage($this->package)); + } + $this->objectAction = new TemplateAction(array(), 'create', array('data' => array( + 'application' => $this->application, 'templateName' => $this->tplName, 'packageID' => $this->packageID, 'templateGroupID' => $this->templateGroupID diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 3930441ade..df1b8d6edf 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -589,8 +589,8 @@ CREATE TABLE wcf1_template ( application VARCHAR(255) NOT NULL, templateGroupID INT(10), lastModificationTime INT(10) NOT NULL DEFAULT 0, - UNIQUE KEY applicationTemplate (application, templateName), - UNIQUE KEY templateGroupID (application, templateGroupID, templateName) + UNIQUE KEY applicationTemplate (application, templateGroupID, templateName), + KEY templateGroupID (packageID, templateGroupID, templateName) ); DROP TABLE IF EXISTS wcf1_template_group;