Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possibly unefined $form variables in smarty templates #21735

Merged
merged 1 commit into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</tfoot>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

</table>
{if $payment_required == true}
{if $form.is_pay_later.label}
{if !empty($form.is_pay_later.label)}
<div class="crm-section {$form.is_pay_later.name}-section">
<div class="label">{$form.is_pay_later.label}</div>
<div class="content">{$form.is_pay_later.html}
Expand All @@ -117,14 +117,14 @@
{/if}

<script type="text/javascript">
{if $form.is_pay_later.name}
{if !empty($form.is_pay_later.name)}
var pay_later_sel = "input#{$form.is_pay_later.name}";
{/if}
{literal}
CRM.$(function($) {

function refresh() {
{/literal}{if $form.is_pay_later.name}{literal}
{/literal}{if !empty($form.is_pay_later.name)}{literal}
var is_pay_later = $(pay_later_sel).prop("checked");
{/literal}{else}
var is_pay_later = false;
Expand All @@ -133,7 +133,7 @@ CRM.$(function($) {
$(".pay-later-instructions").toggle(is_pay_later);
$("div.billingNameInfo-section .description").html(is_pay_later ? "Enter the billing address at which you can be invoiced." : "Enter the name as shown on your credit or debit card, and the billing address for this card.");
}
{/literal}{if $form.is_pay_later.name}{literal}
{/literal}{if !empty($form.is_pay_later.name)}{literal}
$(pay_later_sel).change(function() {
refresh();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="clear"></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

</div>

{if $form.contact_type}
{if !empty($form.contact_type)}
<div class="crm-section contact_type-section">
<div class="label">
{$form.contact_type.label}
Expand All @@ -41,7 +41,7 @@
</div>
{/if}

{if $form.group}
{if !empty($form.group)}
<div class="crm-section group_selection-section">
<div class="label">
{$form.group.label}
Expand All @@ -53,7 +53,7 @@
</div>
{/if}

{if $form.tag}
{if !empty($form.tag)}
<div class="crm-section tag-section">
<div class="label">
{$form.tag.label}
Expand Down
6 changes: 3 additions & 3 deletions templates/CRM/Activity/Form/Search/Common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</td>
</tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<tr>
{if $form.activity_type_id}
{if !empty($form.activity_type_id)}
<td><label>{$form.activity_type_id.label}</label>
<br />
{$form.activity_type_id.html}
Expand Down Expand Up @@ -43,14 +43,14 @@
<td>
<table>
<tr><td>
{if $form.parent_id}
{if !empty($form.parent_id)}
<label>{ts}Has a Followup Activity?{/ts}</label>
<br/>
{$form.parent_id.html}
{/if}
</td></tr>
<tr><td>
{if $form.followup_parent_id}
{if !empty($form.followup_parent_id)}
<label>{ts}Is a Followup Activity?{/ts}</label>
<br/>
{$form.followup_parent_id.html}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Admin/Form/Navigation.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<td class="label">{$form.icon.label} {help id="id-menu_icon" file="CRM/Admin/Form/Navigation.hlp"}</td>
<td>{$form.icon.html} </td>
</tr>
{if $form.parent_id.html}
{if !empty($form.parent_id.html)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<tr class="crm-navigation-form-block-parent_id">
<td class="label">{$form.parent_id.label} {help id="id-parent" file="CRM/Admin/Form/Navigation.hlp"}</td>
<td>{$form.parent_id.html}</td>
Expand Down
28 changes: 14 additions & 14 deletions templates/CRM/Admin/Form/PaymentProcessor.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,37 +58,37 @@
<tr class="crm-paymentProcessor-form-block-user_name">
<td class="label">{$form.user_name.label}</td><td>{$form.user_name.html} {help id=$ppTypeName|cat:'-live-user-name' title=$form.user_name.label}</td>
</tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

{if $form.password}
{if !empty($form.password)}
<tr class="crm-paymentProcessor-form-block-password">
<td class="label">{$form.password.label}</td><td>{$form.password.html} {help id=$ppTypeName|cat:'-live-password' title=$form.password.label}</td>
</tr>
{/if}
{if $form.signature}
{if !empty($form.signature)}
<tr class="crm-paymentProcessor-form-block-signature">
<td class="label">{$form.signature.label}</td><td>{$form.signature.html} {help id=$ppTypeName|cat:'-live-signature' title=$form.signature.label}</td>
</tr>
{/if}
{if $form.subject}
{if !empty($form.subject)}
<tr class="crm-paymentProcessor-form-block-subject">
<td class="label">{$form.subject.label}</td><td>{$form.subject.html} {help id=$ppTypeName|cat:'-live-subject' title=$form.subject.label}</td>
</tr>
{/if}
{if $form.url_site}
{if !empty($form.url_site)}
<tr class="crm-paymentProcessor-form-block-url_site">
<td class="label">{$form.url_site.label}</td><td>{$form.url_site.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-live-url-site' title=$form.url_site.label}</td>
</tr>
{/if}
{if $form.url_api}
{if !empty($form.url_api)}
<tr class="crm-paymentProcessor-form-block-url_api">
<td class="label">{$form.url_api.label}</td><td>{$form.url_api.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-live-url-api' title=$form.url_api.label}</td>
</tr>
{/if}
{if $form.url_recur}
{if !empty($form.url_recur)}
<tr class="crm-paymentProcessor-form-block-url_recur">
<td class="label">{$form.url_recur.label}</td><td>{$form.url_recur.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-live-url-recur' title=$form.url_recur.label}</td>
</tr>
{/if}
{if $form.url_button}
{if !empty($form.url_button)}
<tr class="crm-paymentProcessor-form-block-url_button">
<td class="label">{$form.url_button.label}</td><td>{$form.url_button.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-live-url-button' title=$form.url_button.label}</td>
</tr>
Expand All @@ -101,37 +101,37 @@
<table class="form-layout-compressed">
<tr class="crm-paymentProcessor-form-block-test_user_name">
<td class="label">{$form.test_user_name.label}</td><td>{$form.test_user_name.html} {help id=$ppTypeName|cat:'-test-user-name' title=$form.test_user_name.label}</td></tr>
{if $form.test_password}
{if !empty($form.test_password)}
<tr class="crm-paymentProcessor-form-block-test_password">
<td class="label">{$form.test_password.label}</td><td>{$form.test_password.html} {help id=$ppTypeName|cat:'-test-password' title=$form.test_password.label}</td>
</tr>
{/if}
{if $form.test_signature}
{if !empty($form.test_signature)}
<tr class="crm-paymentProcessor-form-block-test_signature">
<td class="label">{$form.test_signature.label}</td><td>{$form.test_signature.html} {help id=$ppTypeName|cat:'-test-signature' title=$form.test_signature.label}</td>
</tr>
{/if}
{if $form.test_subject}
{if !empty($form.test_subject)}
<tr class="crm-paymentProcessor-form-block-test_subject">
<td class="label">{$form.test_subject.label}</td><td>{$form.test_subject.html} {help id=$ppTypeName|cat:'-test-subject' title=$form.test_subject.label}</td>
</tr>
{/if}
{if $form.test_url_site}
{if !empty($form.test_url_site)}
<tr class="crm-paymentProcessor-form-block-test_url_site">
<td class="label">{$form.test_url_site.label}</td><td>{$form.test_url_site.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-test-url-site' title=$form.test_url_site.label}</td>
</tr>
{/if}
{if $form.test_url_api}
{if !empty($form.test_url_api)}
<tr class="crm-paymentProcessor-form-block-test_url_api">
<td class="label">{$form.test_url_api.label}</td><td>{$form.test_url_api.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-test-url-api' title=$form.test_url_api.label}</td>
</tr>
{/if}
{if $form.test_url_recur}
{if !empty($form.test_url_recur)}
<tr class="crm-paymentProcessor-form-block-test_url_recur">
<td class="label">{$form.test_url_recur.label}</td><td>{$form.test_url_recur.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-test-url-recur' title=$form.test_url_recur.label}</td>
</tr>
{/if}
{if $form.test_url_button}
{if !empty($form.test_url_button)}
<tr class="crm-paymentProcessor-form-block-test_url_button">
<td class="label">{$form.test_url_button.label}</td><td>{$form.test_url_button.html|crmAddClass:huge} {help id=$ppTypeName|cat:'-test-url-button' title=$form.test_url_button.label}</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Admin/Form/Preferences/Display.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
</table>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
</div>
{if $form.contact_edit_options.html}
{if !empty($form.contact_edit_options.html)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

{literal}
<script type="text/javascript">
CRM.$(function($) {
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Admin/Form/PreferencesDate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<tr class="crm-preferences-date-form-block-date_format">
<td class="label">{$form.date_format.label}</td><td>{$form.date_format.html}</td>
</tr>
{if $form.time_format.label}
{if !empty($form.time_format.label)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<tr class="crm-preferences-date-form-block-time_format">
<td class="label">{$form.time_format.label}</td><td>{$form.time_format.html}</td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions templates/CRM/Admin/Form/Setting/Localization.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<td class="label">{$form.lcMessages.label}</td>
<td>{$form.lcMessages.html}</td>
</tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

{if $form.languageLimit}
{if !empty($form.languageLimit)}
<tr class="crm-localization-form-block-languageLimit">
<td class="label">{$form.languageLimit.label}</td>
<td>{$form.languageLimit.html}<br />
Expand All @@ -37,7 +37,7 @@
<span class="description">{$settings_fields.inheritLocale.description}</span>
</td>
</tr>
{if !$form.languageLimit}
{if empty($form.languageLimit)}
<tr class="crm-localization-form-block-uiLanguages">
<td class="label">{$form.uiLanguages.label}</td>
<td>{$form.uiLanguages.html}</td>
Expand Down Expand Up @@ -104,7 +104,7 @@
</table>
<h3>{ts}Multiple Languages Support{/ts}</h3>
<table class="form-layout-compressed">
{if $form.makeSinglelingual}
{if !empty($form.makeSinglelingual)}
<tr class="crm-localization-form-block-makeSinglelingual_description">
<td></td>
<td><span class="description">{ts 1="http://documentation.civicrm.org"}This is a multilingual installation. It contains certain schema differences compared to regular installations of CiviCRM. Please <a href="%1">refer to the documentation</a> for details.{/ts}</span></td>
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Admin/Form/Setting/UF.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<td class="label">{$form.userFrameworkUsersTableName.label}</td>
<td>{$form.userFrameworkUsersTableName.html}</td>
</tr>
{if $form.wpBasePage}
{if !empty($form.wpBasePage)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<tr class="crm-uf-form-block-wpBasePage">
<td class="label">{$form.wpBasePage.label}</td>
<td>{$config->userFrameworkBaseURL}{$form.wpBasePage.html}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Campaign/Form/ResultOptions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</td>
</tr>

<tr id="option_group" {if !$form.option_group_id}class="hiddenElement"{/if}>
<tr id="option_group" {if empty($form.option_group_id)}class="hiddenElement"{/if}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<td class="label">{$form.option_group_id.label}</td>
<td class="html-adjust">{$form.option_group_id.html}</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Case/Form/Activity.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
</td>
</tr>
{/if}
{if $form.tag.html}
{if !empty($form.tag.html)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<tr class="crm-case-activity-form-block-tag">
<td class="label">{$form.tag.label}</td>
<td class="view-value">
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Case/Form/ActivityTab.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{$form.activity_type_filter_id.html}
</td>
</tr>
{if $form.activity_deleted}
{if !empty($form.activity_deleted)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<tr class="crm-case-caseview-form-block-activity_deleted">
<td>
{$form.activity_deleted.html}{$form.activity_deleted.label}
Expand Down
6 changes: 3 additions & 3 deletions templates/CRM/Case/Form/Case.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</tr>
{/if}

{if $form.activity_details.html}
{if !empty($form.activity_details.html)}
<tr class="crm-case-form-block-activity_details">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<td class="label">{$form.activity_details.label}{help id="id-details" activityTypeFile=$activityTypeFile file="CRM/Case/Form/Case.hlp"}</td>
<td class="view-value">{$form.activity_details.html|crmStripAlternatives}</td>
Expand All @@ -68,7 +68,7 @@
</tr>
{/if}

{if $form.activity_subject.html}
{if !empty($form.activity_subject.html)}
<tr class="crm-case-form-block-activity_subject">
<td class="label">{$form.activity_subject.label}{help id="id-activity_subject" activityTypeFile=$activityTypeFile file="CRM/Case/Form/Case.hlp"}</td>
<td>{$form.activity_subject.html|crmAddClass:huge}</td>
Expand All @@ -80,7 +80,7 @@
{include file="CRM/Case/Form/Activity/$activityTypeFile.tpl"}
{/if}

{if $form.duration.html}
{if !empty($form.duration.html)}
<tr class="crm-case-form-block-duration">
<td class="label">{$form.duration.label}</td>
<td class="view-value">
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Case/Form/Search/Common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<br />
{$form.case_owner.html}
{/if}
{if $form.case_deleted}
{if !empty($form.case_deleted)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<br />
{$form.case_deleted.html}
{$form.case_deleted.label}
Expand Down
8 changes: 4 additions & 4 deletions templates/CRM/Contact/Form/Edit/Individual.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{* tpl for building Individual related fields *}
<table class="form-layout-compressed">
<tr>
{if $form.prefix_id}
{if !empty($form.prefix_id)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<td>
{$form.prefix_id.label}<br/>
{$form.prefix_id.html}
Expand All @@ -22,19 +22,19 @@
{$form.formal_title.html}
</td>
{/if}
{if $form.first_name}
{if !empty($form.first_name)}
<td>
{$form.first_name.label}<br />
{$form.first_name.html}
</td>
{/if}
{if $form.middle_name}
{if !empty($form.middle_name)}
<td>
{$form.middle_name.label}<br />
{$form.middle_name.html}
</td>
{/if}
{if $form.last_name}
{if !empty($form.last_name)}
<td>
{$form.last_name.label}<br />
{$form.last_name.html}
Expand Down
12 changes: 6 additions & 6 deletions templates/CRM/Contact/Form/Inline/ContactName.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,37 @@
{include file="CRM/common/formButtons.tpl"}
</div>
{if $contactType eq 'Individual'}
{if $form.prefix_id}
{if !empty($form.prefix_id)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

<div class="crm-inline-edit-field">
{$form.prefix_id.label}<br/>
{$form.prefix_id.html}
</div>
{/if}
{if $form.formal_title}
{if !empty($form.formal_title)}
<div class="crm-inline-edit-field">
{$form.formal_title.label}<br/>
{$form.formal_title.html}
</div>
{/if}
{if $form.first_name}
{if !empty($form.first_name)}
<div class="crm-inline-edit-field">
{$form.first_name.label}<br />
{$form.first_name.html}
</div>
{/if}
{if $form.middle_name}
{if !empty($form.middle_name)}
<div class="crm-inline-edit-field">
{$form.middle_name.label}<br />
{$form.middle_name.html}
</div>
{/if}
{if $form.last_name}
{if !empty($form.last_name)}
<div class="crm-inline-edit-field">
{$form.last_name.label}<br />
{$form.last_name.html}
</div>
{/if}
{if $form.suffix_id}
{if !empty($form.suffix_id)}
<div class="crm-inline-edit-field">
{$form.suffix_id.label}<br/>
{$form.suffix_id.html}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contact/Form/OnBehalfOf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@

</fieldset>

{if $form.is_for_organization}
{if !empty($form.is_for_organization)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this file = ok

{include file="CRM/common/showHideByFieldValue.tpl"
trigger_field_id ="is_for_organization"
trigger_value ="true"
Expand Down
Loading