smarty icon indicating copy to clipboard operation
smarty copied to clipboard

debug.tpl uses {Smarty::SMARTY_VERSION} but compiler thinks this is a disallowed static method call

Open j-applese3d opened this issue 4 months ago • 0 comments

Steps to reproduce:

  1. add {debug} to your .tpl file
  2. call $smarty->display('the_file.tpl');

Note the deprecation notice:

Using unregistered static method "Smarty::SMARTY_VERSION" in a template is deprecated and will be removed in a future release. Use Smarty::registerClass to explicitly register a class for access. in vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php on line 2430

I'm on Smarty Version 4.5.4.

https://github.com/smarty-php/smarty/blob/a1b4c9c551d01ff63220f053966c7aaa9053f89d/src/debug.tpl#L111 Suggest changing the above line to use {$smarty.version}, unless it's better to register the class -- in which case it should get registered within smarty_internal_debug.php

j-applese3d avatar Oct 16 '24 16:10 j-applese3d