Edit user account - problem with php 8.1 (OJS 3.3.0-14)

Hi,
We use OJS 3.3.0-1 with PHP Version 8.1.16.
When attempting to edit a user account, we get: Failed Ajax request or invalid JSON.
In the error.log we conclude that there is a PHP syntax error.

[Tue Apr 11 13:58:34.321864 2023] [proxy_fcgi:error] [pid 3742832:tid 3742879] [client 188.47.119.63:0] AH01071: Got error ‘PHP message: PHP Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php on line 36’, referer:
[Tue Apr 11 13:58:34.986412 2023] [proxy_fcgi:error] [pid 3571849:tid 3572057] [client 188.47.119.63:0] AH01071: Got error ‘PHP message: PHP Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php on line 36PHP message: PHP Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php on line 117’, referer:

[Tue Apr 11 14:04:07.577748 2023] [proxy_fcgi:error] [pid 3571848:tid 3571962] [client 188.47.119.63:0] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given in
/public_html/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php:36\nStack trace:\n#0 /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php(36): htmlspecialchars()\n#1
/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php(1793): smarty_modifier_escape()\n#2 /public_html/cache/t_compile/2122dd4b4d038d06701b7a5cbc73d21546ea835d_0.app.formtextInput.tpl.php(59): PKPTemplateManager->smartyEscape()\n#3 /public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_64351011b5a7c6_42
00
/public_html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): S…’, referer

Do you have a solution for this?

Best regards
Peter

Hi, this is a really important topic in the context of installing the latest version of the software in the php 8.1 environment. I will ask for information. Thanks

Hi @karwas,

This has already been fixed (along with other similar issues) as part of Add PHP8.1 testing to Travis environment · Issue #7690 · pkp/pkp-lib · GitHub. The changes will be released with 3.3.0-15, probably in a few weeks. Meanwhile, you can move to PHP 7.x or 8.0 to avoid the issue.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi, @asmecher Thanks for the answer. We will be waiting.
Currently we had to downgrade to php74 version.
Version 8.0 - did not work.
Greetings
Peter

This topic was automatically closed after 10 days. New replies are no longer allowed.