Commit 63552466 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixed broken init in phpunit run. Fixed access to uninitialized var. Throw...

Fixed broken init in phpunit run. Fixed access to uninitialized var. Throw exception if dndTable or form is missing.
parent 7630d349
Pipeline #1187 passed with stage
in 1 minute and 37 seconds
......@@ -1303,7 +1303,7 @@ abstract class AbstractBuildForm {
$formElement[F_FE_DATA_PATTERN_ERROR] = empty($sanitizeMessage) ? F_FE_DATA_PATTERN_ERROR_DEFAULT : $sanitizeMessage;
}
if (empty($formElement[F_FE_DATA_MATCH_ERROR])) {
$formElement[F_FE_DATA_REQUIRED_ERROR] = F_FE_DATA_MATCH_ERROR_DEFAULT;
$formElement[F_FE_DATA_REQUIRED_ERROR] = F_FE_DATA_REQUIRED_ERROR_DEFAULT;
}
$attribute .= $this->getAttributeList($formElement, [F_FE_DATA_PATTERN_ERROR, F_FE_DATA_REQUIRED_ERROR, F_FE_DATA_MATCH_ERROR, F_FE_DATA_ERROR, FE_MIN, FE_MAX, FE_STEP]);
......@@ -2514,7 +2514,7 @@ abstract class AbstractBuildForm {
if (isset($formElement[FE_DND_TABLE])) {
// Table is specified in parameter field
$dndTable = $formElement[FE_DND_TABLE];
} else {
} elseif (!empty($formElement[SUBRECORD_PARAMETER_FORM])) {
// Read table from form specified in subrecord
$formName = $formElement[SUBRECORD_PARAMETER_FORM];
$form = $this->dbArray[$this->dbIndexQfq]->sql("SELECT * FROM Form AS f WHERE f." . F_NAME . " LIKE ? AND f.deleted='no'",
......@@ -2522,6 +2522,11 @@ abstract class AbstractBuildForm {
if (count($form) > 0) {
$dndTable = $form[0][F_TABLE_NAME];
}
} else {
throw new UserFormException(json_encode(
[ERROR_MESSAGE_TO_USER => 'Missing Parameter',
ERROR_MESSAGE_SUPPORT => FE_DND_TABLE . ' or ' . SUBRECORD_PARAMETER_FORM]),
ERROR_MISSING_TABLE_NAME);
}
if ($dndTable) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment