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

civix upgrade for smarty 5 #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url desc="Support">https://github.com/systopia/de.systopia.xcm/issues</url>
<url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate></releaseDate>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like Civix re-formatting the <releaseDate> element as a self-closing tag, as with every released version, this will change the tag format and not just the date value. I always reset that Civix change manually … sorry for being picky 🤓

<releaseDate/>
<version>1.14-dev</version>
<develStage>dev</develStage>
<compatibility>
Expand All @@ -33,7 +33,7 @@
<mixin>[email protected]</mixin>
<mixin>[email protected]</mixin>
<mixin>[email protected]</mixin>
<mixin>[email protected].0</mixin>
<mixin>[email protected].1</mixin>
</mixins>
<upgrader>CRM_Xcm_Upgrader</upgrader>
</extension>
13 changes: 4 additions & 9 deletions mixin/[email protected] → mixin/[email protected]
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