// let the constructor initialize this, should happen only once
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
- self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables);
}
+ // Smarty $_template is a static var which persists between tests, so
+ // if something calls clearTemplateVars(), the static still exists but
+ // our ensured variables get blown away, so we need to set them even if
+ // it's already been initialized.
+ self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables);
+
// Workaround for CRM-15153 - give each form a reasonably unique css class
$this->addClass(CRM_Utils_System::getClassName($this));
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
self::$_session = CRM_Core_Session::singleton();
- self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables);
}
+ // Smarty $_template is a static var which persists between tests, so
+ // if something calls clearTemplateVars(), the static still exists but
+ // our ensured variables get blown away, so we need to set them even if
+ // it's already been initialized.
+ self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables);
// FIXME - why are we messing with 'snippet'? Why not just pass it directly into $this->_print?
if (!empty($_REQUEST['snippet'])) {