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

[php8-compact] Add in guards into various templates to fix issues in … #20544

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

seamuslee001
Copy link
Contributor

…test runs on php8

Overview

This adds some more if guards into various templates to support test runs in php8

ping @eileenmcnaughton @totten @colemanw @demeritcowboy

@civibot
Copy link

civibot bot commented Jun 8, 2021

(Standard links)

@civibot civibot bot added the master label Jun 8, 2021
@seamuslee001
Copy link
Contributor Author

jenkins test this please

@@ -22,7 +22,7 @@
<tr class="crm-group-form-block-title">
<td class="label">{$form.title.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_group' field='title' id=$group.id}{/if}</td>
<td>{$form.title.html|crmAddClass:huge}
{if $group.saved_search_id}&nbsp;({ts}Smart Group{/ts}){/if}
{if !empty($group.saved_search_id)}&nbsp;({ts}Smart Group{/ts}){/if}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<td class="crm-report-optionList-label crm-editable" data-field="label">{$row.label}</td>
<td class="crm-report-optionList-value">{$row.value}</td>
<td class="crm-report-optionList-description">{$row.description}</td>
<td class="nowrap crm-report-optionList-order">{$row.weight}</td>
{if $showIsDefault}
{if !empty($showIsDefault)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -39,12 +39,12 @@
</tr>
</thead>
{foreach from=$rows item=row}
<tr id="option_value-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"}{$row.class}{if NOT $row.is_active} crm-report-optionList crm-report-optionList-status_disable disabled{else} crm-report-optionList crm-report-optionList-status_enable{/if}">
<tr id="option_value-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"}{if !empty($row.class)}{$row.class}{/if}{if NOT $row.is_active} crm-report-optionList crm-report-optionList-status_disable disabled{else} crm-report-optionList crm-report-optionList-status_enable{/if}">
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -28,7 +28,7 @@
<th>{ts}URL{/ts}</th>
<th>{ts}Description{/ts}</th>
<th>{ts}Order{/ts}</th>
{if $showIsDefault}
{if !empty($showIsDefault)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -52,7 +52,7 @@
{*pledge row if*}

{*Display honor block*}
{if $pledgeHonor && $pledgeHonorRows}
{if !empty($pledgeHonor) && !empty($pledgeHonorRows)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<td class="crmf-is_current_member crm-editable" data-type="boolean">{if $row.is_current_member eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td class="crmf-is_admin crm-editable" data-type="boolean">{if $row.is_admin eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td class="nowrap crmf-weight">{$row.weight}</td>
<td class="crmf-is_reserved">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td>{$row.action|replace:'xx':$row.id}</td>
<td>{if !empty($row.action)}{$row.action|replace:'xx':$row.id}{/if}</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -36,7 +36,7 @@
<tr class="crm-group-form-block-frontend-title">
<td class="label">{$form.frontend_title.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_group' field='frontend_title' id=$group.id}{/if}</td>
<td>{$form.frontend_title.html|crmAddClass:huge}
{if $group.saved_search_id}&nbsp;({ts}Smart Group{/ts}){/if}
{if !empty($group.saved_search_id)}&nbsp;({ts}Smart Group{/ts}){/if}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -69,14 +69,14 @@
<td>{$form.is_active.html}</td>
</tr>

{if $group.created_by}
{if !empty($group.created_by)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<tr class="crm-group-form-block-created">
<td class="label">{ts}Created By{/ts}</td>
<td>{$group.created_by}</td>
</tr>
{/if}

{if $group.modified_by}
{if !empty($group.modified_by)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -105,10 +105,10 @@

{literal}
<script type="text/javascript">
{/literal}{if $freezeMailingList}{literal}
{/literal}{if !empty($freezeMailingList)}{literal}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

cj('input[type=checkbox][name="group_type[{/literal}{$freezeMailingList}{literal}]"]').prop('disabled',true);
{/literal}{/if}{literal}
{/literal}{if $hideMailingList}{literal}
{/literal}{if !empty($hideMailingList)}{literal}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<h3>{ts}Parent Groups{/ts} {help id="id-group-parent" file="CRM/Group/Page/Group.hlp"}</h3>
{if $parent_groups|@count > 0}
{if isset($parent_groups) and $parent_groups|@count > 0}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -8,9 +8,9 @@
+--------------------------------------------------------------------+
*}
{*CRM-14190*}
{if $parent_groups|@count > 0 or $form.parents.html}
{if (isset($parent_groups) and $parent_groups|@count > 0) or !empty($form.parents.html)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -31,7 +31,7 @@
</tr>
</table>
{/if}
{if $form.organization_id}
{if !empty($form.organization_id)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -8,7 +8,7 @@
+--------------------------------------------------------------------+
*}
<div class="crm-block crm-form-block crm-group-search-form-block">
<div class="crm-accordion-wrapper crm-search_builder-accordion {if $rows and !$showSearchForm}collapsed{/if}">
<div class="crm-accordion-wrapper crm-search_builder-accordion {if $rows and empty($showSearchForm)}collapsed{/if}">
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

</td>
{if !empty($form.created_by)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

{ts}Complete OR partial creator name.{/ts}
</span>
</td>
{/if}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

</td>
<td colspan="2">
</td>
{if !empty($form.group_type_search)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

{ts}Filter search by group type(s).{/ts}
</span>
</td>
{/if}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

</span>
</td>
{/if}
{if !empty($form.group_status)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

{$form.group_status.html}
</td>
{/if}
{if !empty($form.component_mode)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

</tr>
{if !empty($form.saved_search)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -81,7 +91,7 @@
<th data-data="description" data-orderable="false" cell-class="crm-group-description crmf-description {$editableClass}" class='crm-group-description'>{ts}Description{/ts}</th>
<th data-data="group_type" cell-class="crm-group-group_type" class='crm-group-group_type'>{ts}Group Type{/ts}</th>
<th data-data="visibility" cell-class="crm-group-visibility crmf-visibility {$editableClass}" cell-data-type="select" class='crm-group-visibility'>{ts}Visibility{/ts}</th>
{if $showOrgInfo}
{if !empty($showOrgInfo)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -125,7 +135,7 @@
d.status = groupStatus,
d.savedSearch = $('.crm-group-search-form-block select#saved_search').val(),
d.component_mode = $(".crm-group-search-form-block select#component_mode").val(),
d.showOrgInfo = {/literal}"{$showOrgInfo}"{literal},
d.showOrgInfo = {/literal}{if isset($showOrgInfo)}"{$showOrgInfo}"{else}"0"{/if}{literal},
Copy link
Contributor

Choose a reason for hiding this comment

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

ok - I guess I can see the reason for is to be 0 not empty

@@ -174,7 +184,7 @@
// show hide children
var context = $('#crm-main-content-wrapper');
$('table.crm-group-selector', context).on( 'click', 'span.show-children', function(){
var showOrgInfo = {/literal}"{$showOrgInfo}"{literal};
var showOrgInfo = {/literal}{if isset($showOrgInfo)}"{$showOrgInfo}"{else}"0"{/if}{literal};
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -45,7 +45,7 @@ var isMailing = false;
{/literal}
{/if}

{if $templateSelected}
{if !empty($templateSelected)}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -38,17 +38,17 @@
<th></th>
</thead>
{foreach from=$rows item=row}
<tr id="membership_status-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class} {if NOT $row.is_active} disabled{/if} crmf">
<tr id="membership_status-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {if !empty($row.class)}{$row.class}{/if} {if NOT $row.is_active} disabled{/if} crmf">
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<td class="nowrap crmf-start_event_adjust_unit_interval">{$row.start_event_adjust_unit_interval}</td>
<td class="nowrap crmf-end_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{$row.end_event}</td>
<td class="nowrap crmf-end_event_adjust_interval">{$row.end_event_adjust_interval}</td>
<td class="nowrap crmf-start_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{if !empty($row.start_event)}{$row.start_event}{/if}</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<td class="nowrap crmf-end_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{$row.end_event}</td>
<td class="nowrap crmf-end_event_adjust_interval">{$row.end_event_adjust_interval}</td>
<td class="nowrap crmf-start_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{if !empty($row.start_event)}{$row.start_event}{/if}</td>
<td class="nowrap crmf-start_event_adjust_unit_interval">{if !empty($start_event_adjust_unit_interval)}{$row.start_event_adjust_unit_interval}{/if}</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

this line and the line 2 down are checking a variable before presenting the key within the row array - is that right?

<td class="nowrap crmf-end_event_adjust_interval">{$row.end_event_adjust_interval}</td>
<td class="nowrap crmf-start_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{if !empty($row.start_event)}{$row.start_event}{/if}</td>
<td class="nowrap crmf-start_event_adjust_unit_interval">{if !empty($start_event_adjust_unit_interval)}{$row.start_event_adjust_unit_interval}{/if}</td>
<td class="nowrap crmf-end_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{if !empty($row.end_event)}{$row.end_event}{/if}</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<td class="nowrap crmf-start_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{if !empty($row.start_event)}{$row.start_event}{/if}</td>
<td class="nowrap crmf-start_event_adjust_unit_interval">{if !empty($start_event_adjust_unit_interval)}{$row.start_event_adjust_unit_interval}{/if}</td>
<td class="nowrap crmf-end_event crm-editable" data-type="select" data-empty-option="{ts}- none -{/ts}">{if !empty($row.end_event)}{$row.end_event}{/if}</td>
<td class="nowrap crmf-end_event_adjust_interval">{if !empty($end_event_adjust_unit_interval)}{$row.end_event_adjust_interval}{/if}</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

possible issue per above

@eileenmcnaughton
Copy link
Contributor

OK - I think we got everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants