From: Eileen McNaughton Date: Wed, 1 Nov 2023 22:37:57 +0000 (+1300) Subject: Reduce smarty notices on civireport pages X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3596cf25eee9d55319692866c07343f62c52c4d4;p=civicrm-core.git Reduce smarty notices on civireport pages --- diff --git a/templates/CRM/Report/Form/Layout/Table.tpl b/templates/CRM/Report/Form/Layout/Table.tpl index d27ff1f48e..e38b1c907a 100644 --- a/templates/CRM/Report/Form/Layout/Table.tpl +++ b/templates/CRM/Report/Form/Layout/Table.tpl @@ -97,7 +97,7 @@ {assign var=fieldLink value=$field|cat:"_link"} {assign var=fieldHover value=$field|cat:"_hover"} {assign var=fieldClass value=$field|cat:"_class"} - + {if array_key_exists($fieldLink, $row) && $row.$fieldLink} {/if} - {if is_array($row.$field)} + {if array_key_exists($field, $row) && is_array($row.$field)} {foreach from=$row.$field item=fieldrow key=fieldid}
{$fieldrow}
{/foreach} - {elseif $row.$field eq 'Subtotal'} + {elseif array_key_exists($field, $row) && $row.$field eq 'Subtotal'} {$row.$field} {elseif $header.type & 4 OR $header.type & 256} {if $header.group_by eq 'MONTH' or $header.group_by eq 'QUARTER'} @@ -129,7 +129,7 @@ {else} {$row.$field|crmMoney} {/if} - {else} + {elseif array_key_exists($field, $row)} {$row.$field|smarty:nodefaults|purify} {/if} @@ -150,7 +150,7 @@ {else} {$grandStat.$field|crmMoney} {/if} - {else} + {elseif array_key_exists($field, $grandStat)} {$grandStat.$field} {/if}