From: Alexander Ebert Date: Thu, 30 May 2013 21:28:39 +0000 (+0200) Subject: Fixed cache reset after changing labels / label groups X-Git-Tag: 2.0.0_Beta_2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=526ccccd71a3dd79b39b8692af3a0d5a0999f641;p=GitHub%2FWoltLab%2FWCF.git Fixed cache reset after changing labels / label groups --- diff --git a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php index 1a24dba2de..5023e7bda7 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php @@ -3,6 +3,7 @@ namespace wcf\acp\form; use wcf\data\label\group\LabelGroupList; use wcf\data\label\LabelAction; use wcf\data\label\LabelEditor; +use wcf\data\object\type\ObjectTypeCache; use wcf\data\package\PackageCache; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; @@ -168,6 +169,11 @@ class LabelAddForm extends AbstractForm { )); } + $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.label.objectType'); + foreach ($objectTypes as $objectType) { + $objectType->getProcessor()->save(); + } + $this->saved(); // reset values diff --git a/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php index 58f2023100..c4c0d3ad7f 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php @@ -2,6 +2,7 @@ namespace wcf\acp\form; use wcf\data\label\Label; use wcf\data\label\LabelAction; +use wcf\data\object\type\ObjectTypeCache; use wcf\data\package\PackageCache; use wcf\form\AbstractForm; use wcf\system\exception\IllegalLinkException; @@ -77,6 +78,11 @@ class LabelEditForm extends LabelAddForm { ))); $this->objectAction->executeAction(); + $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.label.objectType'); + foreach ($objectTypes as $objectType) { + $objectType->getProcessor()->save(); + } + $this->saved(); // reset values if non-custom value was choosen diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index 3f615f7599..3b9fdfb967 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -143,7 +143,11 @@ class LabelGroupAddForm extends AbstractForm { // save object type relations $this->saveObjectTypeRelations($returnValues['returnValues']->groupID); - + + foreach ($this->labelObjectTypes as $objectTypeID => $labelObjectType) { + $labelObjectType->save(); + } + $this->saved(); // reset values @@ -223,10 +227,10 @@ class LabelGroupAddForm extends AbstractForm { } // no data provided and no POST data exists - if ($data === null || !is_array($data)) { + /*if ($data === null || !is_array($data)) { // nothing to do here return; - } + }*/ foreach ($this->labelObjectTypeContainers as $objectTypeID => $container) { if ($container->isBooleanOption()) { diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php index 96f95a1df2..5c8ac117a9 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php @@ -11,7 +11,7 @@ use wcf\system\WCF; * Shows the label group edit form. * * @author Alexander Ebert - * @copyright 2001-2012 WoltLab GmbH + * @copyright 2001-2013 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf.label * @subpackage acp.form @@ -72,6 +72,10 @@ class LabelGroupEditForm extends LabelGroupAddForm { // update object type relations $this->saveObjectTypeRelations($this->groupID); + foreach ($this->labelObjectTypes as $objectTypeID => $labelObjectType) { + $labelObjectType->save(); + } + $this->saved(); // show success