Fixes phone edition: only notifies an phone modification if it is actually modified.
authorStéphane Jacob <jacou@melix.net>
Sun, 12 Apr 2009 14:03:18 +0000 (16:03 +0200)
committerStéphane Jacob <jacou@melix.net>
Sun, 12 Apr 2009 14:10:48 +0000 (16:10 +0200)
modules/profile/page.inc.php

index 8a5014f..b84355c 100644 (file)
@@ -146,10 +146,21 @@ class ProfilePhones implements ProfileSetting
                                    WHERE  t.uid = {?} AND t.link_type = {?}
                                 ORDER BY  t.tel_id",
                                  $this->id, $this->link_type);
-            $value = $res->fetchAllAssoc();
+            if ($res->numRows() > 0) {
+                $value = $res->fetchAllAssoc();
+            } else {
+                $value = array(
+                        0 => array(
+                            'type'    => 'fixed',
+                            'tel'     => '',
+                            'pub'     => 'private',
+                            'comment' => '',
+                            )
+                        );
+            }
         }
         foreach ($value as $key=>&$phone) {
-            if (@$phone['removed']) {
+            if (isset($phone['removed']) && $phone['removed']) {
                 unset($value[$key]);
             } else {
                 unset($phone['removed']);