N°5865 - Restore DoCheckToWrite error messages in portal

This commit is contained in:
Stephen Abello
2023-02-22 10:17:34 +01:00
parent dbd58cfeb6
commit 6d019615d0

View File

@@ -31,6 +31,7 @@ use Combodo\iTop\Form\Field\LabelField;
use Combodo\iTop\Form\Form;
use Combodo\iTop\Form\FormManager;
use Combodo\iTop\Portal\Helper\ApplicationHelper;
use CoreCannotSaveObjectException;
use DBObject;
use DBObjectSearch;
use DBObjectSet;
@@ -1145,6 +1146,9 @@ class ObjectFormManager extends FormManager
{
$this->oObject->DBWrite();
}
catch (CoreCannotSaveObjectException $e) {
throw new Exception($e->getHtmlMessage());
}
catch (Exception $e) {
if ($bIsNew) {
throw new Exception(Dict::S('Portal:Error:ObjectCannotBeCreated'));