Fixed cache reset after changing labels / label groups
authorAlexander Ebert <ebert@woltlab.com>
Thu, 30 May 2013 21:28:39 +0000 (23:28 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 30 May 2013 21:28:39 +0000 (23:28 +0200)
wcfsetup/install/files/lib/acp/form/LabelAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php

index 1a24dba2de8c1f84a921ba566c31f460d4db282f..5023e7bda79659a0ad42b5e251640d2f9fd539aa 100644 (file)
@@ -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
index 58f2023100a47fe361b571c75aafa811f1028567..c4c0d3ad7f0333e0a8e3f1486db57c339ab5a444 100644 (file)
@@ -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
index 3f615f75999856ec97cebadb8b0f0e3e7673da9b..3b9fdfb967a2965b0d23dc2f34f699dd0e74d522 100644 (file)
@@ -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()) {
index 96f95a1df2360f526688230965d563d202cc772f..5c8ac117a9b8921c32add3da8e2640e1859981d7 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
  * @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