This removes an isset from LangSwitch and some enotices that we see if escape on output is enabled.
'langSwitch' is normally always assigned by the smarty initialize but for some reason not via this path
if ($config->isUpgradeMode()) {
return NULL;
}
+ CRM_Core_Smarty::singleton()->ensureVariablesAreAssigned(['langSwitch', 'breadcrumb', 'pageTitle']);
if (!self::getProperty($id, 'active')) {
return NULL;
return $output;
}
+ /**
+ * Ensure these variables are set to make it easier to access them without e-notice.
+ *
+ * @param array $variables
+ */
+ public function ensureVariablesAreAssigned(array $variables): void {
+ foreach ($variables as $variable) {
+ if (!isset($this->get_template_vars()[$variable])) {
+ $this->assign($variable);
+ }
+ }
+ }
+
/**
* Fetch a template (while using certain variables)
*
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-{if isset($langSwitch) and $langSwitch|@count > 1}
+{if $langSwitch|@count > 1}
<form action="#">
<select name="lcMessages" onchange="window.location='{crmURL q="$queryString"}'+this.value">
{foreach from=$langSwitch item=language key=locale}