Commit 434db4af authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'F7156ReportDoubleDefinition' into 'master'

Fixes #7156 - Throw exception when a report level is defined twice.

See merge request !291
parents d5c2d74b 22b42bbe
Pipeline #4213 canceled with stages
......@@ -275,6 +275,7 @@ const ERROR_TOO_FEW_PARAMETER_FOR_SENDMAIL = 1408;
const ERROR_TOO_MANY_PARAMETER = 1409;
const ERROR_INVALID_SAVE_PDF_FILENAME = 1410;
const ERROR_TWIG_COLUMN_NOT_UNIQUE = 1411;
const ERROR_DOUBLE_DEFINITION = 1412;
// Upload
const ERROR_UPLOAD = 1500;
......
......@@ -302,8 +302,14 @@ class Report {
*/
private function setLine($level, $frCmd, $value) {
$index = $level . "." . $frCmd;
// throw exception if this level was already defined
if(!empty($this->frArray[$index])) {
throw new \UserReportException ("Double definition: $index is defined more than once.", ERROR_DOUBLE_DEFINITION);
}
// store complete line reformatted in frArray
$this->frArray[$level . "." . $frCmd] = $value;
$this->frArray[$index] = $value;
// per sql command
//pro sql cmd wird der Indexarray abgefüllt. Dieser wird später verwendet um auf den $frArray zuzugreifen
......
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