diff --git a/changelog.md b/changelog.md index d1ec7f6..b62963d 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ### All notable changes to `CRM CLient V2` will be documented in this file. # version 3.0.1 +- Fixed : Customer do not call update if there are no updated fields - Fixed : WPCrm bootSessionIfNeeded trying to access $_SESSION['wpcrm'] before session was started - Fixed : WPCrm now only returns a boolean - Fixed : get crm info when client used in laravel diff --git a/src/Models/Customer.php b/src/Models/Customer.php index 78ba1b3..3d715f4 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -445,10 +445,14 @@ class Customer extends CrmClientModel Utils::setRawProperty($this, 'password', null); } return $saved; - } - if ($saved = $this->update()) { - $this->updatedValues = []; - Utils::setRawProperty($this, 'password', null); + } else { + if (empty($this->updatedValues)) { + return true; + } + if ($saved = $this->update()) { + $this->updatedValues = []; + Utils::setRawProperty($this, 'password', null); + } } return $saved; }