Browse Source

Fix Call to undefined method Twig\Template::findTemplateFilePath()

Because Twig also uses the "Template" class name
Julio Montoya 6 years ago
parent
commit
5eb426eac6
2 changed files with 6 additions and 1 deletions
  1. 5 0
      main/inc/lib/api.lib.php
  2. 1 1
      main/inc/lib/template.lib.php

+ 5 - 0
main/inc/lib/api.lib.php

@@ -9426,3 +9426,8 @@ function api_set_noreply_and_from_address_to_mailer(PHPMailer $mailer, array $se
 
     $mailer->SetFrom($senderEmail, $senderName, !$avoidReplyToAddress);
 }
+
+function api_find_template($template)
+{
+    return Template::findTemplateFilePath($template);
+}

+ 1 - 1
main/inc/lib/template.lib.php

@@ -175,7 +175,7 @@ class Template
             ],
             [
                 'name' => 'get_template',
-                'callable' => 'Template::findTemplateFilePath',
+                'callable' => 'api_find_template',
             ],
             [
                 'name' => 'date_to_time_ago',