Note I'm not seeing any regressions on this locally with enotice turned on - but the
worst case, if tests pass, is we get some enotices back in a scenario where we
are only impacting bleeding edge devs
*/
public $useLivePageJS;
+ /**
+ * Variables smarty expects to have set.
+ *
+ * We ensure these are assigned (value = NULL) when Smarty is instantiated in
+ * order to avoid e-notices / having to use empty or isset in the template layer.
+ *
+ * @var string[]
+ */
+ public $expectedSmartyVariables = ['breadcrumb', 'pageTitle', 'isForm', 'hookContent'];
+
/**
* Class constructor.
*
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
self::$_session = CRM_Core_Session::singleton();
+ self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables);
}
// FIXME - why are we messing with 'snippet'? Why not just pass it directly into $this->_print?
<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
- {if isset($isForm) and $isForm and isset($formTpl)}
+ {if $isForm and $formTpl}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
- {if isset($isForm) and $isForm and isset($formTpl)}
+ {if $isForm and $formTpl}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body' allowCmsOverride=0}
- {if $isForm and isset($formTpl)}
+ {if $isForm and $formTpl}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
*}
{* printBody.tpl: wrapper for Print views without HTML surrounds. *}
-{if $isForm and isset($formTpl)}
+{if $isForm and $formTpl}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}