From: Seamus Lee Date: Sun, 6 Jun 2021 02:19:23 +0000 (+0000) Subject: [php8-compat][REF] Fix more php8 test failures caused by template issues X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a221e1e0ba42492dac0ab42e0add88444d22eaab;p=civicrm-core.git [php8-compat][REF] Fix more php8 test failures caused by template issues --- diff --git a/tests/templates/message_templates/event_online_receipt_text.tpl b/tests/templates/message_templates/event_online_receipt_text.tpl index 370b9de737..ee0b109e86 100644 --- a/tests/templates/message_templates/event_online_receipt_text.tpl +++ b/tests/templates/message_templates/event_online_receipt_text.tpl @@ -14,7 +14,9 @@ participant_status:::{$participant_status} {if isset($pricesetFieldsCount)} pricesetFieldsCount:::{$pricesetFieldsCount} {/if} +{if !empty($isPrimary)} isPrimary:::{$isPrimary} +{/if} {if isset($conference_sessions)} conference_sessions:::{$conference_sessions} {/if} diff --git a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl index c9d2f9e251..91ab088c22 100644 --- a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl @@ -60,7 +60,7 @@ {$country} - {$source} + {if !empty($source)}{$source}{/if} {if $domain_email}{$domain_email}{/if} diff --git a/xml/templates/message_templates/contribution_offline_receipt_html.tpl b/xml/templates/message_templates/contribution_offline_receipt_html.tpl index d8b9ba9bbe..1ce25413a0 100644 --- a/xml/templates/message_templates/contribution_offline_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_offline_receipt_html.tpl @@ -46,12 +46,14 @@ - - {ts}Financial Type{/ts} - - - {$formValues.contributionType_name} - + {if !empty($formValues.contributionType_name)} + + {ts}Financial Type{/ts} + + + {$formValues.contributionType_name} + + {/if} {if !empty($lineItem) and empty($is_quick_config)} diff --git a/xml/templates/message_templates/contribution_offline_receipt_text.tpl b/xml/templates/message_templates/contribution_offline_receipt_text.tpl index 846d1a4498..c21cc9797a 100644 --- a/xml/templates/message_templates/contribution_offline_receipt_text.tpl +++ b/xml/templates/message_templates/contribution_offline_receipt_text.tpl @@ -9,7 +9,9 @@ =========================================================== {ts}Contributor{/ts}: {contact.display_name} +{if !empty($formValues.contributionType_name)} {ts}Financial Type{/ts}: {$formValues.contributionType_name} +{/if} {if $lineItem} {foreach from=$lineItem item=value key=priceset} --------------------------------------------------------- diff --git a/xml/templates/message_templates/event_offline_receipt_html.tpl b/xml/templates/message_templates/event_offline_receipt_html.tpl index 15fec07acc..daa4c2e5af 100644 --- a/xml/templates/message_templates/event_offline_receipt_html.tpl +++ b/xml/templates/message_templates/event_offline_receipt_html.tpl @@ -147,7 +147,7 @@ {if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} - {if $isPrimary} + {if !empty($isPrimary)} {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} @@ -255,10 +255,10 @@ {/if} - {if $isPrimary} + {if !empty($isPrimary)} - {if $balanceAmount} + {if isset($balanceAmount)} {ts}Total Paid{/ts} {else} {ts}Total Amount{/ts} diff --git a/xml/templates/message_templates/event_offline_receipt_text.tpl b/xml/templates/message_templates/event_offline_receipt_text.tpl index 2e8b682de6..d13ea7ddb5 100644 --- a/xml/templates/message_templates/event_offline_receipt_text.tpl +++ b/xml/templates/message_templates/event_offline_receipt_text.tpl @@ -8,7 +8,7 @@ {ts}You have been added to the WAIT LIST for this event.{/ts} -{if $isPrimary} +{if !empty($isPrimary)} {ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts} {/if} @@ -19,7 +19,7 @@ {ts}Your registration has been submitted.{/ts} -{if $isPrimary} +{if !empty($isPrimary)} {ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts} {/if} diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index 0d95412df9..30b1e258bd 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -186,7 +186,7 @@ {if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} - {if $isPrimary} + {if !empty($isPrimary)} {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} @@ -299,7 +299,7 @@ {/if} - {if $isPrimary} + {if !empty($isPrimary)} {ts}Total Amount{/ts} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index 04f25cf514..c17bf558a3 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -24,7 +24,7 @@ {ts}Your registration has been submitted.{/ts} -{if $isPrimary} +{if !empty($isPrimary)} {ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts} {/if} @@ -106,7 +106,7 @@ You were registered by: {$payer.name} {if !empty($lineItem)}{foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} -{if $isPrimary} +{if !empty($isPrimary)} {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} {ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info} diff --git a/xml/templates/message_templates/event_registration_receipt_html.tpl b/xml/templates/message_templates/event_registration_receipt_html.tpl index 2040b451fc..9cce5dc6a4 100644 --- a/xml/templates/message_templates/event_registration_receipt_html.tpl +++ b/xml/templates/message_templates/event_registration_receipt_html.tpl @@ -16,7 +16,7 @@

{else}

- This is being sent to you as a {if $is_refund}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase. + This is being sent to you as a {if !empty($is_refund)}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase.

{/if} @@ -24,7 +24,7 @@

{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}

{/if} -

Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if} +

Your order number is #{$transaction_id}. {if !empty($line_items) && empty($is_refund)} Information about the workshops will be sent separately to each participant.{/if} Here's a summary of your transaction placed on {$transaction_date|date_format:"%D %I:%M %p %Z"}:

{if $billing_name} @@ -62,7 +62,7 @@ {/if} -{if $source} +{if !empty($source)}

 

{$source} {/if} diff --git a/xml/templates/message_templates/event_registration_receipt_text.tpl b/xml/templates/message_templates/event_registration_receipt_text.tpl index 5a6807609e..907c074586 100644 --- a/xml/templates/message_templates/event_registration_receipt_text.tpl +++ b/xml/templates/message_templates/event_registration_receipt_text.tpl @@ -3,14 +3,14 @@ {if $is_pay_later} This is being sent to you as an acknowledgement that you have registered one or more members for the following workshop, event or purchase. Please note, however, that the status of your payment is pending, and the registration for this event will not be completed until your payment is received. {else} - This is being sent to you as a {if $is_refund}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase. + This is being sent to you as a {if !empty($is_refund)}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase. {/if} {if $is_pay_later} {if isset($pay_later_receipt)}{$pay_later_receipt}{/if} {/if} - Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if} + Your order number is #{$transaction_id}. {if !empty($line_items) && empty($is_refund)} Information about the workshops will be sent separately to each participant.{/if} Here's a summary of your transaction placed on {$transaction_date|date_format:"%D %I:%M %p %Z"}: {if $billing_name} @@ -27,7 +27,7 @@ {$email} {/if} -{if $source} +{if !empty($source)} {$source} {/if} diff --git a/xml/templates/message_templates/membership_offline_receipt_html.tpl b/xml/templates/message_templates/membership_offline_receipt_html.tpl index 2fd5ec20d9..9de7e49895 100644 --- a/xml/templates/message_templates/membership_offline_receipt_html.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_html.tpl @@ -76,7 +76,7 @@ {ts}Membership Fee{/ts} - {if $formValues.contributionType_name} + {if !empty($formValues.contributionType_name)} {ts}Financial Type{/ts} diff --git a/xml/templates/message_templates/membership_offline_receipt_text.tpl b/xml/templates/message_templates/membership_offline_receipt_text.tpl index a35591eb3f..715aff3654 100644 --- a/xml/templates/message_templates/membership_offline_receipt_text.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_text.tpl @@ -24,7 +24,7 @@ {ts}Membership Fee{/ts} =========================================================== -{if $formValues.contributionType_name} +{if !empty($formValues.contributionType_name)} {ts}Financial Type{/ts}: {$formValues.contributionType_name} {/if} {if !empty($lineItem)}