Skip to content

Commit

Permalink
LEAF 3288 common error log items. form indicator conditions.
Browse files Browse the repository at this point in the history
Prevent conditions set to 'null' for new form imports.
Handle existing forms if they contain conditions set to 'null'.
  • Loading branch information
aerinkayne committed Dec 20, 2024
1 parent 21662ed commit 88fa4e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions LEAF_Request_Portal/sources/FormStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ private function importIndicator($indicatorPackage, $categoryID, $parentID = nul
{
$indicatorPackage['categoryID'] = $categoryID;
$indicatorPackage['parentID'] = $parentID;
//an issue on conditions editor release could cause some form packets to have 'null' instead of null.
if($indicatorPackage['conditions'] === 'null') {
$indicatorPackage['conditions'] = null;
}

if (is_array($indicatorPackage['options']))
{
Expand Down
2 changes: 1 addition & 1 deletion LEAF_Request_Portal/templates/subindicators.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@
<!--{$indicator.html}-->
<!--{/if}-->
<!--{include file=$subindicatorsTemplate form=$indicator.child depth=$depth+4 recordID=$recordID}-->
<!--{if $indicator.conditions != ''}-->
<!--{if $indicator.conditions != '' && $indicator.conditions != 'null'}-->
<script type="text/javascript">
formConditions["id<!--{$indicator.indicatorID}-->"] = {
conditions:<!--{$indicator.conditions|strip_tags}-->, //no quotes. send as object
Expand Down

0 comments on commit 88fa4e1

Please sign in to comment.