Closed justinbb closed 1 year ago
Good you also caught this. The comment was also wrong for the equivalent date function. These are now fixed in the master
branch.
I found many other problems, not only due to the new PHP type signatures but also with the legacy callbacks using wrong parameters. More fixes to come.
Fix released in 3.15.1.
Describe the bug Because of a type error in the declaration of qtranxf_dateFromCommentForCurrentLanguage() and qtranxf_timeFromCommentForCurrentLanguage(), display of any article with comments crashes.
Debug info PHP 7 error message:
PHP Fatal error: Uncaught TypeError: Argument 5 passed to qtranxf_timeFromCommentForCurrentLanguage() must be of the type string or null, object given, called in /public_html/wp-includes/class-wp-hook.php on line 303 and defined in /public_html/wp-content/plugins/qtranslate-xt/src/date_time.php:433
PHP 8 error message:
PHP Fatal error: Uncaught TypeError: qtranxf_timeFromCommentForCurrentLanguage(): Argument #5 ($comment) must be of type ?string, WP_Comment given, called in /public_html/wp-includes/class-wp-hook.php on line 303 and defined in /public_html/wp-content/plugins/qtranslate-xt/src/date_time.php:433
Additional context New problem in qtranslate-xt 3.15.0. The argument has always been a WP_Comment, but explicit typing was not previously present.