• Resolved skryter

    (@skryter)


    When I try to write a comment on a blog entry, I get the following error message:

    Warning: strpos() expects parameter 1 to be string, object given in D:\www\www678\de\wp-includes\formatting.php on line 2434 Warning: strtr() expects parameter 1 to be string, object given in D:\www\www678\de\wp-includes\formatting.php on line 2435 Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in D:\www\www678\de\wp-includes\formatting.php:5304 Stack trace: #0 D:\www\www678\de\wp-includes\formatting.php(5304): preg_replace() #1 D:\www\www678\de\wp-includes\class-wp-hook.php(303): wp_strip_all_tags() #2 D:\www\www678\de\wp-includes\plugin.php(189): WP_Hook->apply_filters() #3 D:\www\www678\de\wp-includes\comment.php(2114): apply_filters() #4 D:\www\www678\de\wp-includes\comment.php(2262): wp_filter_comment() #5 D:\www\www678\de\wp-includes\comment.php(3566): wp_new_comment() #6 D:\www\www678\de\wp-comments-post.php(25): wp_handle_comment_submission() #7 {main} thrown in D:\www\www678\de\wp-includes\formatting.php on line 5304

    php Version: 7.4
    WordPress Version: 5.8.1

    • This topic was modified 3 years ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 7 replies - 1 through 7 (of 7 total)
  • Samuel O.

    (@wpcoworker)

    What is the site URL where you facing this error?

    I recall similar issue reported by someone long back. After lot of debugging resetting the timezone in “Settings > General” fixed the issue. Please try that.

    Thread Starter skryter

    (@skryter)

    You can try it at https://www.skill-mentoring.ch/index.php/2021/09/30/skill-mentoring-making-off/

    Still the same error after resetting the timezone.

    Samuel O.

    (@wpcoworker)

    I could replicate the error. Another reason why this may happen is when the siteurl or home option do not contain actual siteurl.

    Please add following to your theme’s functions.php file and then refresh the page and try adding a comment:

    update_option( 'siteurl', 'https://www.skill-mentoring.ch');
    update_option( 'home', 'https://www.skill-mentoring.ch');

    If that works, you can remove or comment out these lines.

    Wajid Ali

    (@wajid-ali-tabassum)

    Hi, @skryter I am supposing that there is a theme or plugin conflict. Please make sure that WordPress, the activated theme, and all plugins are up-to-date.

    Please do a basic troubleshooting by deactivating all plugins one by one and check this warring along.

    If you see there is not any plugin confliction then switch on the default WordPress theme and check the error again.

    Hope this helps.

    Thread Starter skryter

    (@skryter)

    @wpcoworker: Added it to the themes functions.php. The error is still showing up.

    @wajid-ali-tabassum: disabled all plugins and switched to a default theme. Doesn’t change anything, the error is still showing up.

    Thread Starter skryter

    (@skryter)

    After some debugging I’ve got the following error message: “wpdb_get_table_charset_failure”.

    So I’ve checked the database and the tables “wp_comments” and “wp_commentmeta” were missing..

    Samuel O.

    (@wpcoworker)

    Oh…missing “wp_comments” and “wp_commentmeta” tables was a big issue. I see your comments are working now. So you managed to restore those tables from old database backup? Any idea how those got deleted?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error when writing comment on a blog entry’ is closed to new replies.