• Resolved TheArcturian

    (@thearcturian)


    After upgrading to latest version 1.3.5 I get a lot of repeating errors in the event log of the server:

    php[8328]; WordPress database error Unknown character set: ‘utf8mb4’ for query

    ALTER TABLE wp_calendar_categories
    CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci

    Is this a known error? Would be nice to have it fixed.

    https://wordpress.org/plugins/calendar/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Kieran O’Shea

    (@kieranoshea)

    Thanks for flagging this up. I’ve done some reading and I think I’ve found the issue. Will look to get a fix out in the next couple of days.

    Thread Starter TheArcturian

    (@thearcturian)

    Sounds great. Thanks!

    If you need a temporary fix to use the plugin while you are waiting for the author to provide a permanent solution, you can modify this line of code in the calendar.php. It’s most likely that your MySQL server setup doesn’t handle utf8mb4 charsets.

    Lines 775-781

    // We've installed/upgraded now, just need to check the charsets
        $charset = $wpdb->get_results("select table_collation from information_schema.tables where table_name like '" . WP_CALENDAR_TABLE . "%' and table_collation not like 'utf8mb4%'");
        if (!empty($charset)) {
            $wpdb->get_results("ALTER TABLE " . WP_CALENDAR_TABLE . " CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
            $wpdb->get_results("ALTER TABLE " . WP_CALENDAR_CONFIG_TABLE . " CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
            $wpdb->get_results("ALTER TABLE " . WP_CALENDAR_CATEGORIES_TABLE . " CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
        }

    change to…

    // We've installed/upgraded now, just need to check the charsets
        $charset = $wpdb->get_results("select table_collation from information_schema.tables where table_name like '" . WP_CALENDAR_TABLE . "%' and table_collation not like 'utf8%'");
        if (!empty($charset)) {
            $wpdb->get_results("ALTER TABLE " . WP_CALENDAR_TABLE . " CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci");
            $wpdb->get_results("ALTER TABLE " . WP_CALENDAR_CONFIG_TABLE . " CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci");
            $wpdb->get_results("ALTER TABLE " . WP_CALENDAR_CATEGORIES_TABLE . " CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci");
        }
    Thread Starter TheArcturian

    (@thearcturian)

    Thank you very much for the fix, Kjansen! Works without any errors now. Great! Thanks for taking the time to share. 🙂

    Plugin Author Kieran O’Shea

    (@kieranoshea)

    The fix for this should be out by the end of the week, sorry for the delay

    Plugin Author Kieran O’Shea

    (@kieranoshea)

    A fix for this has been rolled out tonight in the latest version so you shouldn’t see a recurrence of this now.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Lots of errors in event log: WordPress database error Unknown character set’ is closed to new replies.