rtrim(): Passing null to parameter #1 ($string) of type string is deprecated
-
Hi,
I’m a TP Premium user. But somehow the error lies in the free plugin version.
The issue was noticed thanks to Query Monitor plugin. Using it, you will likely be able to see the PHP deprecation warning upon using TP with URL translation.
It appears the issue resides in class-url-converter.php that returns a null parameter to a string, which would be deprecated by PHP 8. That is my understanding as a sysadmin, I’m no PHP dev, so a direct look at the error will surely help you better understand the issue.
So here is what Query Monitor reveals:
Deprecated
rtrim(): Passing null to parameter #1 ($string) of type string is deprecated
wp-includes/formatting.php:2819
rtrim()
wp-includes/formatting.php:2819
untrailingslashit()
wp-includes/formatting.php:2804
trailingslashit()
wp-content/plugins/translatepress-multilingual/includes/class-url-converter.php:437
TRP_Url_Converter->get_url_for_language()
wp-content/plugins/translatepress-multilingual/partials/language-switcher-shortcode.php:22
TRP_Language_Switcher->language_switcher()
wp-includes/shortcodes.php:434
do_shortcode_tag()
wp-includes/shortcodes.php:434
preg_replace_callback()
wp-includes/shortcodes.php:273
do_shortcode()
wp-content/plugins/translatepress-multilingual/includes/gutenberg-blocks/ls-shortcode/ls-shortcode.php:142
TRP_Gutenberg_Blocks->{closure}()
wp-includes/class-wp-hook.php:324
do_action('trp/language-switcher/render_callback')
wp-content/plugins/translatepress-multilingual/includes/gutenberg-blocks/ls-shortcode/ls-shortcode.php:24
TRP_Gutenberg_Blocks->{closure}()
wp-includes/class-wp-block.php:519
WP_Block->render()
wp-includes/class-wp-block.php:499
WP_Block->render()
wp-includes/class-wp-block.php:499
WP_Block->render()
wp-includes/class-wp-block.php:499
WP_Block->render()
wp-includes/blocks.php:2061
render_block()
wp-includes/blocks.php:2113
do_blocks()
wp-includes/blocks/template-part.php:154
render_block_core_template_part()
wp-includes/class-wp-block.php:519
WP_Block->render()
wp-includes/blocks.php:2061
render_block()
wp-includes/blocks.php:2113
do_blocks()
wp-includes/block-template.php:260
get_the_block_template_html()
wp-includes/template-canvas.php:12
1 Extension : translatepress-multilingualI hope this is useful in some way! And I remain available if further details are required to help diagnose and resolve the issue.
Best regards
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.