Using Piwigo with PHP 8.2 gives lots of deprecation notices in the smarty library.
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$registerPlugin is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$registerFilter is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$append is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$getTemplateVars is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Warning: Cannot modify header information - headers already sent by (output started at …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php:182) in …/include/page_header.php on line 99
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$unregisterFilter is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_template.php on line 719
I see that Piwigo is using version 4.1 of Smarty. According to the changelog, compatibility with PHP 8.2 was introduced with version 4.3
Alternatively, just ignore deprecations by changing this line.
In general, you would want to see deprecations in test/development, but not in live environments.
Using Piwigo with PHP 8.2 gives lots of deprecation notices in the smarty library.
```
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$registerPlugin is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$registerFilter is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$append is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$getTemplateVars is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Warning: Cannot modify header information - headers already sent by (output started at …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php:182) in …/include/page_header.php on line 99
Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$unregisterFilter is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in …/include/smarty/libs/sysplugins/smarty_internal_template.php on line 719
```
I see that Piwigo is using version 4.1 of Smarty. According to the [ changelog](https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md), compatibility with PHP 8.2 was introduced with version 4.3
Alternatively, just ignore deprecations by changing this line.
https://github.com/Piwigo/Piwigo/blob/4729504aac02545e9d5e27717cbf7f9ce3663b9d/include/config_default.inc.php#L501
In general, you would want to see deprecations in test/development, but not in live environments.
<!-- github-sync-id:1518876926 -->
I made a first try to update Smarty to version 4.3.1 and I get a lot of these warnings :
Deprecated: Using php-function "sprintf" as a modifier is deprecated and will be removed in a future release. [...]
Deprecated: Using php-function "urlencode" as a modifier is deprecated and will be removed in a future release. [...]
Deprecated: Using php-function "intval" as a modifier is deprecated and will be removed in a future release. [...]
It's going to be a complicated update...
I made a first try to update Smarty to version 4.3.1 and I get a lot of these warnings :
> Deprecated: Using php-function "sprintf" as a modifier is deprecated and will be removed in a future release. [...]
> Deprecated: Using php-function "urlencode" as a modifier is deprecated and will be removed in a future release. [...]
> Deprecated: Using php-function "intval" as a modifier is deprecated and will be removed in a future release. [...]
It's going to be a complicated update...
<!-- github-comment-id:1508918524 -->
Hi
ok for sprintf
try in include/template.class.php add line 114 $this->smarty->registerPlugin('modifier', 'sprintf', 'sprintf');
try add line 115 for urlenconde $this->smarty->registerPlugin('modifier', 'urlencode', 'urlencode');
try add line 116 for intval $this->smarty->registerPlugin('modifier', 'intval', 'intval');
if that's a solution
Hi
ok for sprintf
try in include/template.class.php add line 114
`$this->smarty->registerPlugin('modifier', 'sprintf', 'sprintf');`
try add line 115 for urlenconde
`$this->smarty->registerPlugin('modifier', 'urlencode', 'urlencode');`
try add line 116 for intval
`$this->smarty->registerPlugin('modifier', 'intval', 'intval');`
if that's a solution
<!-- github-comment-id:1510092613 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Using Piwigo with PHP 8.2 gives lots of deprecation notices in the smarty library.
I see that Piwigo is using version 4.1 of Smarty. According to the changelog, compatibility with PHP 8.2 was introduced with version 4.3
Alternatively, just ignore deprecations by changing this line.
https://github.com/Piwigo/Piwigo/blob/4729504aac02545e9d5e27717cbf7f9ce3663b9d/include/config_default.inc.php#L501
In general, you would want to see deprecations in test/development, but not in live environments.
I made a first try to update Smarty to version 4.3.1 and I get a lot of these warnings :
It's going to be a complicated update...
Hi
ok for sprintf
try in include/template.class.php add line 114
$this->smarty->registerPlugin('modifier', 'sprintf', 'sprintf');try add line 115 for urlenconde
$this->smarty->registerPlugin('modifier', 'urlencode', 'urlencode');try add line 116 for intval
$this->smarty->registerPlugin('modifier', 'intval', 'intval');if that's a solution
Much better with all these
Ok with that in addition
$this->smarty->registerPlugin('modifier', 'ucfirst', 'ucfirst');FYI, new Debian stable (12) is only with php8.2.