Project60 / org.project60.sepa

SEPA direct debit integration with civicrm
19 stars 46 forks source link

Compatibility with CiviCRM 5.69.2 / Smarty V3 #697

Open Detsieber opened 5 months ago

Detsieber commented 5 months ago

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.

francescbassas commented 1 month ago

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 commented 1 month ago

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

francescbassas commented 1 month ago

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

bjendres commented 1 month ago

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 commented 1 month ago

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