From 9b0d289de2d3cf6d9a78af9c915acd3eb8a882d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sun, 12 Apr 2009 16:03:18 +0200 Subject: [PATCH] Fixes phone edition: only notifies an phone modification if it is actually modified. --- modules/profile/page.inc.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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']); -- 2.1.4