Users can now be added through ACP again
authorAlexander Ebert <ebert@woltlab.com>
Fri, 2 Dec 2011 19:27:38 +0000 (20:27 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 2 Dec 2011 19:27:38 +0000 (20:27 +0100)
Fixes #273

wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php

index ee50ce36902bc5e56890c1fe6dbbc68e2f9bb38d..5718f999aec0d7770cc898d2e2932805aa407a37 100644 (file)
@@ -72,7 +72,9 @@ class UserOptionHandler extends OptionHandler {
                $optionData = parent::getOption($optionName);
                
                $optionData['object'] = new ViewableUserOption($optionData['object']);
-               $optionData['object']->setOptionValue($this->user);
+               if ($this->user !== null) {
+                       $optionData['object']->setOptionValue($this->user);
+               }
                
                if ($this->removeEmptyOptions && empty($optionData['object']->optionValue)) {
                        return null;
@@ -107,7 +109,9 @@ class UserOptionHandler extends OptionHandler {
         * @see wcf\system\option\OptionHandler::checkVisibility()
         */
        protected function checkVisibility(Option $option) {
-               $option->setUser($this->user);
+               if ($this->user !== null) {
+                       $option->setUser($this->user);
+               }
                
                return $option->isVisible();
        }