fix: error return when adding a category to an object

This commit is contained in:
Theo 2021-10-22 15:33:57 +02:00
parent b2a4bd8854
commit 311522bf04

View File

@ -199,7 +199,7 @@ if ($elemid && $action == 'addintocategory' &&
if ($result >= 0) {
setEventMessages($langs->trans("WasAddedSuccessfully", $newobject->ref), null, 'mesgs');
} else {
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), null, 'warnings');
} else {
setEventMessages($object->error, $object->errors, 'errors');