systopia / de.systopia.donrec

CiviCRM Donation Receipts Extension
GNU Affero General Public License v3.0
15 stars 25 forks source link

Compatibility with CiviCRM 5.69.2 / Smarty V3 #189

Closed Detsieber closed 4 months ago

Detsieber commented 7 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/Donrec/Form/Search/RemoveFields.snippet.tpl'"
  "code" => null
  "exception" => SmartyException {#19847
    #message: "Unable to load template 'file:CRM/Donrec/Form/Search/RemoveFields.snippet.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/Donrec/Form/Search/RemoveFields.snippet.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/86/f3/1d/86f31d4430e4332d43fa5209278976ff58db7744_0.file.snippet.tpl.php:79 { …}
      /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:233 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Page/Tab.php:480 { …}
      /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:55:37+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:4))
#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}

[error] 
$Fatal Error Details = array:3 [
  "message" => "Unable to load template 'file:CRM/Admin/Form/Setting/DonrecSettings.tpl' in 'file:CRM/Form/default.tpl'"
  "code" => null
  "exception" => SmartyException {#18347
    #message: "Unable to load template 'file:CRM/Admin/Form/Setting/DonrecSettings.tpl' in 'file:CRM/Form/default.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_template.php:385 { …}
      /html/wordpress/wp-content/uploads/civicrm/templates_c/de_DE/04/32/1a/04321a769030f52d5e20541dd14f6faa9535c76d_0.file.default.tpl.php:53 {
        content_65acf68c011461_16050171(Smarty_Internal_Template $_smarty_tpl)
        › 
        ›     <?php $_smarty_tpl->_subTemplateRender($_smarty_tpl->tpl_vars['tplFile']->value, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, true);
        › ?>
        arguments: {
          $template: "CRM/Admin/Form/Setting/DonrecSettings.tpl"
          $cache_id: null
          $compile_id: null
          $caching: 0
          $cache_lifetime: 3600
          $data: []
          $scope: 0
          $forceTplCache: true
        }
      }
      /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/fd/21/c1/fd21c199098b8efb545bea2c9783982378ab87f4_0.file.CMSPrint.tpl.php:100 { …}
      /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/QuickForm/Action/Display.php:117 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php:83 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:355 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php:98 { …}
      /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:295 { …}
      /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 12:02:00+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:4))
#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}

[error] 
$Fatal Error Details = array:3 [
  "message" => "Unable to load template 'file:CRM/Admin/Page/DonrecProfiles.tpl' in 'file:CRM/common/CMSPrint.tpl'"
  "code" => null
  "exception" => SmartyException {#18406
    #message: "Unable to load template 'file:CRM/Admin/Page/DonrecProfiles.tpl' in 'file:CRM/common/CMSPrint.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_template.php:385 { …}
      /html/wordpress/wp-content/uploads/civicrm/templates_c/de_DE/fd/21/c1/fd21c199098b8efb545bea2c9783982378ab87f4_0.file.CMSPrint.tpl.php:103 {
        content_65acf66b6258e5_11555872(Smarty_Internal_Template $_smarty_tpl)
        ›     <?php } else { ?>
        ›       <?php $_smarty_tpl->_subTemplateRender($_smarty_tpl->tpl_vars['tplFile']->value, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, true);
        › ?>
        arguments: {
          $template: "CRM/Admin/Page/DonrecProfiles.tpl"
          $cache_id: null
          $compile_id: null
          $caching: 0
          $cache_lifetime: 3600
          $data: []
          $scope: 0
          $forceTplCache: true
        }
      }
      /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/uploads/civicrm/ext/de.systopia.donrec/CRM/Admin/Page/DonrecProfiles.php:76 { …}
      /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 12:03:51+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:5))
#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.

jensschuppe commented 5 months ago

@Detsieber Could you try whether #193 fixes those issues for you?

sluc23 commented 5 months ago

@jensschuppe we are facing the same issue with upgraded site in CiviCRM-5.69.5 / Smartyv3 the fix #193 does the trick!

would it be possible to roll out a new release with this civix upgrade included? thanks!

pminf commented 2 months ago

Hey, could you please release a new version including this fix, so that we can use Smarty 3?

jensschuppe commented 2 months ago

The fix has been released with version 2.2.10 already.