Fix user option conditions in user bulk processing
authorMatthias Schmidt <gravatronics@live.com>
Tue, 19 Jan 2016 19:27:53 +0000 (20:27 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 19 Jan 2016 19:27:53 +0000 (20:27 +0100)
wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php

index cf445a6c7da9d783004cbe53b85c82c71851172b..5c727d9df36c88a353aa8ee6b1dafbf16c0cb4ae 100644 (file)
@@ -21,7 +21,7 @@ use wcf\util\StringUtil;
  * Shows the user bulk processing form.
  * 
  * @author     Marcel Werk
- * @copyright  2001-2014 WoltLab GmbH
+ * @copyright  2001-2015 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage acp.form
@@ -144,6 +144,15 @@ class UserBulkProcessingForm extends UserOptionListForm {
         */
        public $activeOptions = array();
        
+       /**
+        * @see \wcf\acp\form\AbstractOptionListForm::initOptionHandler()
+        */
+       protected function initOptionHandler() {
+               $this->optionHandler->enableSearchMode();
+               
+               parent::initOptionHandler();
+       }
+       
        /**
         * @see \wcf\form\IForm::readFormParameters()
         */
@@ -269,10 +278,11 @@ class UserBulkProcessingForm extends UserOptionListForm {
                        $this->conditions->add('user_table.activationCode <> ?', array(0));
                }
                
-               // dynamic fields
-               foreach ($this->activeOptions as $name => $option) {
-                       $value = isset($this->values[$option['optionName']]) ? $this->values[$option['optionName']] : null;
-                       $this->getTypeObject($option['optionType'])->getCondition($this->conditions, $option, $value);
+               foreach ($this->optionHandler->getCategoryOptions('profile') as $option) {
+                       $option = $option['object'];
+                       
+                       $value = isset($this->optionHandler->optionValues[$option->optionName]) ? $this->optionHandler->optionValues[$option->optionName] : null;
+                       $this->optionHandler->getTypeObject($option->optionType)->getCondition($this->conditions, $option, $value);
                }
                
                // call buildConditions event
@@ -465,12 +475,6 @@ class UserBulkProcessingForm extends UserOptionListForm {
                
                $this->availableGroups = $this->getAvailableGroups();
                
-               foreach ($this->activeOptions as $name => $option) {
-                       if (isset($this->values[$name])) {
-                               $this->activeOptions[$name]['optionValue'] = $this->values[$name];
-                       }
-               }
-               
                $this->options = $this->optionHandler->getCategoryOptions('profile');
        }