diff --git a/VERSIONS_HOTLINE/199203 b/VERSIONS_HOTLINE/199203 new file mode 100644 index 0000000000000000000000000000000000000000..19949085d11f560feecddf1d74fc054cab4ad425 --- /dev/null +++ b/VERSIONS_HOTLINE/199203 @@ -0,0 +1 @@ + - correctif #199203 : Correction d'une erreur à la validation de modifications d'usager \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Emprunteur.php b/library/Class/WebService/SIGB/Emprunteur.php index 4f11aa30a5679f0ffacb4d19f8d3ab90f93cf05b..9f4f5c65759c849dc47e67c37635023445370bb1 100644 --- a/library/Class/WebService/SIGB/Emprunteur.php +++ b/library/Class/WebService/SIGB/Emprunteur.php @@ -734,7 +734,7 @@ class Class_WebService_SIGB_Emprunteur { public function ensureAndSave(Class_Users $user) : bool { $this->ensureService($user); if ($user->isAbonne() && $this->_service) - return $this->save(); + return $this->save($user); return $this->isNullInstance(); } @@ -806,13 +806,13 @@ class Class_WebService_SIGB_Emprunteur { } - public function save() : bool { + public function save(?Class_Users $user = null) : bool { if ( ! isset($this->_service)) return false; $this->_service->saveEmprunteur($this); - if ( ! $this->_service->hasErrors()) { - Class_WebService_SIGB_EmprunteurCache::newInstance()->save($user, $this); + if ( ! $this->_service->hasErrors() && $user) { + $this->_saveCache($user); return true; } @@ -821,6 +821,13 @@ class Class_WebService_SIGB_Emprunteur { } + protected function _saveCache(?Class_Users $user = null): void + { + if ($user) + Class_WebService_SIGB_EmprunteurCache::newInstance()->save($user, $this); + } + + public function resetPassword() { if (!isset($this->_service)) return false;