Fixes bug in AbstractOptionListForm
authorMatthias Schmidt <gravatronics@live.com>
Tue, 22 Nov 2011 07:42:07 +0000 (08:42 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 22 Nov 2011 07:42:07 +0000 (08:42 +0100)
Adds missing $loadActiveOptions property which is needed and already used by UserEditForm to ensure that the active options are loaded after the active user has been set.

wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php

index c15b5eafa6c1d8d5c6bc20ee97b0fb4e71f466ee..f4d36d38baf2bc67c0415c8ba61252fb9e5decfe 100755 (executable)
@@ -16,18 +16,18 @@ use wcf\system\option\OptionHandler;
  */
 abstract class AbstractOptionListForm extends AbstractForm {
        /**
-        * @see wcf\form\AbstractForm::$errorField
+        * @see wcf\form\AbstractForm::$errorField
         */
        public $errorField = array();
        
        /**
-        * @see wcf\form\AbstractForm::$errorType
+        * @see wcf\form\AbstractForm::$errorType
         */
        public $errorType = array();
        
        /**
         * cache name
-        * @var string
+        * @var string
         */
        public $cacheName = 'option';
        
@@ -38,8 +38,8 @@ abstract class AbstractOptionListForm extends AbstractForm {
        public $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder';
        
        /**
-        * Name of the active option category.
-        * @var string
+        * name of the active option category
+        * @var string
         */
        public $categoryName = '';
        
@@ -49,6 +49,12 @@ abstract class AbstractOptionListForm extends AbstractForm {
         */
        protected $languageItemPattern = '';
        
+       /**
+        * true if active options are loaded when option handler is initialized
+        * @var boolean
+        */
+       public $loadActiveOptions = true;
+       
        /**
         * option handler object
         * @var wcf\system\option\IOptionHandler
@@ -68,16 +74,16 @@ abstract class AbstractOptionListForm extends AbstractForm {
        public $supportI18n = true;
        
        /**
-        * @see wcf\page\Page::readParameters()
+        * @see wcf\page\IPage::readParameters()
         */
        public function readParameters() {
                parent::readParameters();
                
-               $this->optionHandler = new $this->optionHandlerClassName($this->cacheName, $this->cacheClass, $this->supportI18n, $this->languageItemPattern, $this->categoryName);
+               $this->optionHandler = new $this->optionHandlerClassName($this->cacheName, $this->cacheClass, $this->supportI18n, $this->languageItemPattern, $this->categoryName, $this->loadActiveOptions);
        }
        
        /**
-        * @see wcf\form\IForm::readFormParameters()
+        * @see wcf\form\IForm::readFormParameters()
         */
        public function readFormParameters() {
                parent::readFormParameters();
@@ -86,7 +92,7 @@ abstract class AbstractOptionListForm extends AbstractForm {
        }
        
        /**
-        * @see wcf\form\IForm::validate()
+        * @see wcf\form\IForm::validate()
         */
        public function validate() {
                parent::validate();
@@ -98,6 +104,9 @@ abstract class AbstractOptionListForm extends AbstractForm {
                }
        }
        
+       /**
+        * @see wcf\page\IPage::readData()
+        */
        public function readData() {
                parent::readData();