From: Stéphane Jacob Date: Sun, 12 Apr 2009 14:03:18 +0000 (+0200) Subject: Fixes phone edition: only notifies an phone modification if it is actually modified. X-Git-Tag: xorg/1.0.0~332^2~313^2~13 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9b0d289de2d3cf6d9a78af9c915acd3eb8a882d8;p=platal.git Fixes phone edition: only notifies an phone modification if it is actually modified. --- diff --git a/modules/profile/page.inc.php b/modules/profile/page.inc.php index 8a5014f..b84355c 100644 --- a/modules/profile/page.inc.php +++ b/modules/profile/page.inc.php @@ -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']);