diff --git a/application/Preorder/Preorder.php b/application/Preorder/Preorder.php index ac8a59889..1652bebc1 100644 --- a/application/Preorder/Preorder.php +++ b/application/Preorder/Preorder.php @@ -473,6 +473,12 @@ class Preorder extends mfBaseModel { return true; } + $hausnummer = new ADBHausnummer($this->adb_hausnummer_id); + if(!$hausnummer->id) { + $this->log->warning("[".$this->_ruid."] ".__METHOD__ . ": hausnummer " . $this->adb_hausnummer_id . " not found!"); + return true; + } + $new_status = new Preorderstatus($this->status_id); if(!$new_status->id) { $this->log->warning("[".$this->_ruid."] ".__METHOD__ . ": Preorder has invalid status! ".print_r($this, true)); @@ -493,12 +499,6 @@ class Preorder extends mfBaseModel { return true; } - $hausnummer = new ADBHausnummer($this->adb_hausnummer_id); - if(!$hausnummer->id) { - $this->log->warning("[".$this->_ruid."] ".__METHOD__ . ": hausnummer " . $this->adb_hausnummer_id . " not found!"); - return true; - } - $this->log->debug("[".$this->_ruid."] ".__METHOD__ . ": new hausnummer status code " . $new_hausnummer_status->code); // only update if current status is less than new status @@ -538,7 +538,7 @@ class Preorder extends mfBaseModel { if(!$flag_matrix_item["flag"]) continue; // set hausnummer flag - if($flag_matrix_item["h"]) { + if($flag_matrix_item["h"] && $this->adb_hausnummer_id) { $hflag = ADBStatusflagModel::getFirst(["code" => $flag_matrix_item["h"]]); if(!$hflag) { $this->log->warn("[".$this->_ruid."] "."Statusflag Code ".$flag->code." does not exist"); diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index e9f470219..f7b1cb584 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -1133,7 +1133,7 @@ class PreorderController extends mfBaseController { "preorder_id" => $preorder_id, "create" => (new DateTime("@".$journal->create))->setTimezone(new DateTimeZone("Europe/Vienna"))->format("Y-m-d H:i:s"), "creator" => $journal->creator->name, - "text" => $journal->text, + "text" => htmlentities($journal->text), ]; }