FIX : Error when updating user (#29304)

* FIX : Error management

* FIW : PR returns

* FIX : PR returns error
This commit is contained in:
atm-adrien 2024-04-12 16:31:25 +02:00 committed by GitHub
parent 3076b6ad40
commit 99e85334b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -134,3 +134,4 @@ UserPublicPageDesc=You can enable a virtual card for this user. An url with the
EnablePublicVirtualCard=Enable the user's virtual business card
UserEnabledDisabled=User status changed: %s
AlternativeEmailForOAuth2=Alternative Email for OAuth2 login
ErrorUpdateCanceledDueToDuplicatedUniqueValue=Error, The update was canceled because one of the pieces of data, that should be unique, already exists

View File

@ -550,7 +550,7 @@ if (empty($reshook)) {
$error++;
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors');
setEventMessages($langs->trans("ErrorUpdateCanceledDueToDuplicatedUniqueValue", $object->login), null, 'errors');
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';