Skip to content

Commit

Permalink
Merge pull request #67 from monishdeb/civix_upgrade
Browse files Browse the repository at this point in the history
Run civix upgrade
  • Loading branch information
eileenmcnaughton committed Nov 8, 2023
2 parents 01c3c5a + d2acbda commit 582451c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
<mixins>
<mixin>menu-xml@1.0.0</mixin>
<mixin>scan-classes@1.0.0</mixin>
<mixin>smarty-v2@1.0.0</mixin>
<mixin>smarty-v2@1.0.1</mixin>
</mixins>
</extension>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Auto-register "templates/" folder.
*
* @mixinName smarty-v2
* @mixinVersion 1.0.0
* @mixinVersion 1.0.1
* @since 5.59
*
* @param CRM_Extension_MixInfo $mixInfo
Expand All @@ -19,14 +19,9 @@
}

$register = function() use ($dir) {
// This implementation is useful for older versions of CiviCRM. It can be replaced/updated going forward (v1.1+).
$smarty = CRM_Core_Smarty::singleton();
if (!is_array($smarty->template_dir)) {
$this->template_dir = [$smarty->template_dir];
}
if (!in_array($dir, $smarty->template_dir)) {
array_unshift($smarty->template_dir, $dir);
}
// This implementation has a theoretical edge-case bug on older versions of CiviCRM where a template could
// be registered more than once.
CRM_Core_Smarty::singleton()->addTemplateDir($dir);
};

// Let's figure out what environment we're in -- so that we know the best way to call $register().
Expand Down

0 comments on commit 582451c

Please sign in to comment.