return better error msg if regex is invalid

This commit is contained in:
Uwe Steinmann 2021-09-16 17:11:42 +02:00
parent 56a352caca
commit 4ad5628833
2 changed files with 6 additions and 1 deletions

View File

@ -78,6 +78,7 @@ class SeedDMS_Controller_AttributeMgr extends SeedDMS_Controller_Common {
return false;
}
if (!$attrdef->setRegex($regex)) {
$this->errormsg = 'attrdef_invalid_regex';
return false;
}

View File

@ -163,7 +163,11 @@ else if ($action == "editattrdef") {
$controller->setParam('regex', $regex);
$controller->setParam('attrdef', $attrdef);
if (!$controller($_POST)) {
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
if ($controller->getErrorMsg() != '')
$errormsg = $controller->getErrorMsg();
else
$errormsg = "error_occured";
UI::exitError(getMLText("admin_tools"),getMLText($errormsg));
}
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_attribute')));