From af5a97ad40ff587a7d791c73e493ecce170e35dd Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 11 Mar 2022 08:34:54 +0800 Subject: [PATCH] * Fix bug #20591. --- module/my/control.php | 14 +++++++++++++- module/user/model.php | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 92be67f2b1..5d5ab3710d 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -1029,9 +1029,21 @@ EOF; } elseif($data->mode == 'edit') { + $response['result'] = 'success'; + $response['message'] = $this->lang->saveSuccess; + $this->user->updateContactList($data->listID, $data->listName, $data->users); $this->user->setGlobalContacts($data->listID, isset($data->share)); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('manageContacts', "listID=$listID"))); + + if(dao::isError()) + { + $response['result'] = 'fail'; + $response['message'] = dao::getError(); + return $this->send($response); + } + + $response['locate'] = inlink('manageContacts', "listID=$listID"); + return $this->send($response); } } diff --git a/module/user/model.php b/module/user/model.php index 9f2f8c11c7..258b42e1be 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1478,13 +1478,13 @@ class userModel extends model if(empty($data->listName)) { dao::$errors['listName'][] = sprintf($this->lang->error->notempty, $this->lang->user->contacts->listName); - return print(js::error(dao::getError())); + return false; } $this->dao->update(TABLE_USERCONTACT)->data($data) ->where('id')->eq($listID) ->exec(); - if(dao::isError()) return print(js::error(dao::getError())); + if(dao::isError()) return false; } /**