Skip to content
Snippets Groups Projects
Commit 6db0d24c authored by Alex Arnaud's avatar Alex Arnaud
Browse files

Merge branch...

Merge branch 'hotline#199203_page_blanche_a_la_validation_du_formulaire_d_edition_des_infos_personelles' into 'master'

hotline#199203 : fix error when saving Patron information to SIGB

See merge request !4977
parents 219470df 8720f1de
Branches
Tags
1 merge request!4977hotline#199203 : fix error when saving Patron information to SIGB
Pipeline #32241 canceled with stage
in 7 minutes and 23 seconds
- correctif #199203 : Correction d'une erreur à la validation de modifications d'usager
\ No newline at end of file
...@@ -734,7 +734,7 @@ class Class_WebService_SIGB_Emprunteur { ...@@ -734,7 +734,7 @@ class Class_WebService_SIGB_Emprunteur {
public function ensureAndSave(Class_Users $user) : bool { public function ensureAndSave(Class_Users $user) : bool {
$this->ensureService($user); $this->ensureService($user);
if ($user->isAbonne() && $this->_service) if ($user->isAbonne() && $this->_service)
return $this->save(); return $this->save($user);
return $this->isNullInstance(); return $this->isNullInstance();
} }
...@@ -806,13 +806,13 @@ class Class_WebService_SIGB_Emprunteur { ...@@ -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)) if ( ! isset($this->_service))
return false; return false;
$this->_service->saveEmprunteur($this); $this->_service->saveEmprunteur($this);
if ( ! $this->_service->hasErrors()) { if ( ! $this->_service->hasErrors() && $user) {
Class_WebService_SIGB_EmprunteurCache::newInstance()->save($user, $this); $this->_saveCache($user);
return true; return true;
} }
...@@ -821,6 +821,13 @@ class Class_WebService_SIGB_Emprunteur { ...@@ -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() { public function resetPassword() {
if (!isset($this->_service)) if (!isset($this->_service))
return false; return false;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment