You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
The comment type is not `string` but `WP_Comment`.
Remove default arguments, all must be given in the filter callback.
Clean up obsolete code using global comment variable for older WP.
Fix type signatures in qtranxf_format_* to allow `int` timestamps
when format is 'U'. Add more checks in case `mysql2date` fails.
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.
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.
The text was updated successfully, but these errors were encountered: