Fixes misplaced assignation.
authorStéphane Jacob <sj@m4x.org>
Tue, 18 Oct 2011 08:28:49 +0000 (10:28 +0200)
committerStéphane Jacob <sj@m4x.org>
Tue, 18 Oct 2011 08:54:01 +0000 (10:54 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/profile/general.inc.php

index 2ca66c6..93302c9 100644 (file)
@@ -482,6 +482,7 @@ class ProfileSettingHobby implements ProfileSetting
 
     public function value(ProfilePage $page, $field, $value, &$success)
     {
+        $success = true;
         if (is_null($value)) {
             $value = XDB::fetchAllAssoc('SELECT  type, text, pub
                                            FROM  profile_hobby
@@ -491,7 +492,6 @@ class ProfileSettingHobby implements ProfileSetting
         if (!is_array($value)) {
             return array();
         }
-        $success = true;
         foreach($value as $i => &$hobby) {
             $hobby['text'] = trim($hobby['text']);
             if (!$hobby['text'] ||!in_array($hobby['type'], self::$type)) {