mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
return better error msg if regex is invalid
This commit is contained in:
parent
56a352caca
commit
4ad5628833
|
@ -78,6 +78,7 @@ class SeedDMS_Controller_AttributeMgr extends SeedDMS_Controller_Common {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$attrdef->setRegex($regex)) {
|
if (!$attrdef->setRegex($regex)) {
|
||||||
|
$this->errormsg = 'attrdef_invalid_regex';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,11 @@ else if ($action == "editattrdef") {
|
||||||
$controller->setParam('regex', $regex);
|
$controller->setParam('regex', $regex);
|
||||||
$controller->setParam('attrdef', $attrdef);
|
$controller->setParam('attrdef', $attrdef);
|
||||||
if (!$controller($_POST)) {
|
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')));
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_attribute')));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user