From cb85be5c5d33e49c12f290ce50ed6af15d696208 Mon Sep 17 00:00:00 2001 From: Oceatoon Date: Mon, 22 Jun 2020 23:06:49 +0400 Subject: [PATCH] budget clear bug --- .../tpls/forms/cplx/suiviFromBudgetActions.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/views/tpls/forms/cplx/suiviFromBudgetActions.php b/views/tpls/forms/cplx/suiviFromBudgetActions.php index 9d1cb7e..7b7b153 100644 --- a/views/tpls/forms/cplx/suiviFromBudgetActions.php +++ b/views/tpls/forms/cplx/suiviFromBudgetActions.php @@ -52,8 +52,10 @@ $actions = PHDB::find(Actions::COLLECTION, [ "parentType" => Form::ANSWER_COLLECTION] ); //clear any existing todos -foreach ($answers as $ix => $a) { - $answers[$ix]["todo"] = []; +if(isset($answers)){ + foreach ($answers as $ix => $a) { + $answers[$ix]["todo"] = []; + } } //reset todo with actions foreach ($actions as $id => $a) { @@ -74,11 +76,13 @@ foreach ($actions as $id => $a) { } } //overload existing todo and add to answerObj -foreach ($answers as $ix => $a) { - if(empty($answers[$ix]["todo"])) - unset($answers[$ix]["todo"]); - else - echo ""; +if(isset($answers)){ + foreach ($answers as $ix => $a) { + if(empty($answers[$ix]["todo"])) + unset($answers[$ix]["todo"]); + else + echo ""; + } } $editBtnL = ""; -- GitLab