Fixed: Customer do not call update if there are no updated fields

This commit is contained in:
Jérémy Munsch 2022-02-11 14:57:22 +01:00
parent 7e6efc7d4e
commit 01be799d20
No known key found for this signature in database
GPG key ID: 55196BEE445F6049
2 changed files with 9 additions and 4 deletions

View file

@ -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

View file

@ -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;
}