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

Compatibility with CiviCRM 5.69.2 / Smarty V3 #697

Open
Detsieber opened this issue Jan 21, 2024 · 5 comments
Open

Compatibility with CiviCRM 5.69.2 / Smarty V3 #697

Detsieber opened this issue Jan 21, 2024 · 5 comments

Comments

@Detsieber
Copy link
Member

Starting with Release 5.69.0, CiviCRM supports the long awaited Smarty3 framework. Currently, Smarty3 support is optional, and can be switched off if extensions are incompatible. However, extensions should be updated soon, as it is announced that Smarty2 support will end during the lifetime of CiviCRM 5.69ESR.

If Smarty3 is activated, CiviCRM produces php errors when trying to access contributions:

[error] 
$Fatal Error Details = array:3 [
  "message" => "Unable to load template 'file:CRM/Contact/Page/View/Summary.sepa.tpl'"
  "code" => null
  "exception" => SmartyException {#16911
    #message: "Unable to load template 'file:CRM/Contact/Page/View/Summary.sepa.tpl'"
    #code: 0
    #file: "/html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php"
    #line: 195
    trace: {
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:195 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:232 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:116 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Region.php:81 {
        CRM_Core_Region->{closure}
        › $smarty->assign('snippet', $snippet);
        › $html .= $smarty->fetch($snippet['template']);
        › $smarty->assign('snippet', $tmp);
        arguments: {
          $template: "CRM/Contact/Page/View/Summary.sepa.tpl"
        }
      }
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Region.php:157 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Smarty/plugins/block.crmRegion.php:26 { …}
      /html/wordpress/wp-content/uploads/civicrm/templates_c/de_DE/fd/21/c1/fd21c199098b8efb545bea2c9783982378ab87f4_0.file.CMSPrint.tpl.php:107 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:385 { …}
      /html/wordpress/wp-content/uploads/civicrm/templates_c/de_DE/f8/7f/c2/f87fc2ce92bebf667173fcd96a4344d7f726d60c_0.file.wordpress.tpl.php:31 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:232 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:116 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php:273 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:86 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:322 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm.php:1231 { …}
      /html/wordpress/wp-includes/class-wp-hook.php:324 { …}
      /html/wordpress/wp-includes/class-wp-hook.php:348 { …}
      /html/wordpress/wp-includes/plugin.php:517 { …}
      /html/wordpress/wp-admin/admin.php:259 { …}
    }
  }
]


2024-01-21 11:46:36+0100  [debug] $backTrace = #0 /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(443): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(SmartyException))
#2 /html/wordpress/wp-content/plugins/civicrm/civicrm.php(1231): CRM_Core_Invoke::invoke((Array:3))
#3 /html/wordpress/wp-includes/class-wp-hook.php(324): CiviCRM_For_WordPress->invoke("")
#4 /html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters("", (Array:1))
#5 /html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action((Array:1))
#6 /html/wordpress/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
#7 {main}

There might be more Smarty3 compatibility issues. Hopefully, they are all of the same kind.

jaapjansma added a commit to jaapjansma/sepa_dd that referenced this issue Jan 23, 2024
bjendres added a commit that referenced this issue Apr 25, 2024
Fix for #697: Compatibility with CiviCRM 5.69
@francescbassas
Copy link
Contributor

I get similar errors with 1.9.2 and Smarty 3 activated:

SmartyException: "Unable to load template 'file:CRM/Sepa/Page/DashBoard.tpl' in 'file:CRM/common/CMSPrint.tpl'"

In a custom extension which gave me the same error I solved doing a "civix upgrade"

@bjendres
Copy link
Member

@francescbassas This should be released in 1.10-beta5, have you tried that?

@francescbassas
Copy link
Contributor

Good to know. Not yet. I'm working on the stable release.

@bjendres
Copy link
Member

Good to know. Not yet.

Great! If you could test it and tell me that everything works for you, I'll release it as 1.10.0...

@francescbassas
Copy link
Contributor

I just tested with the 1.10.0 and error is gone. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants