• Resolved tajenli

    (@tajenli)


    I love your plugin and we use it for some mini-snippets in our multisite environment. We recently encountered a problem:

    1. We setup a new blank site, activate WPML.
    2. We added one snippet and found it’s not working (which was working in another subsite of the same network).
    3. We checked the debug.log under /wp-content and we found this error:
    WordPress database error Illegal mix of collations for operation 'UNION' for query SELECT id, code FROM wp_49_snippets WHERE active=1 AND (scope=0 OR scope=2) UNION ALL SELECT id, code FROM wp_ms_snippets WHERE active=1 AND (scope=0 OR scope=2) /* From [tjc.org/eastbayint/] in [/nas/content/live/tjcorg/wp-content/plugins/code-snippets/php/snippet-ops.php:496] */ made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, execute_active_snippets
    4. We checked the tables in DB, the collation of wp_ms_snippets is utf8mb4_unicode_ci, but the collation of wp_49_snippets is utf8mb4_unicode_520_ci.

    How do we fix this issue?
    Thanks!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Well, an easy fix might be to manually convert the coalitions of your database tables to match. A tool such as PhpMyAdmin can do this. I can provide extra instructions if you would like; do you think that this would be possible?

    Thread Starter tajenli

    (@tajenli)

    Hi Shea,
    Thank you for the reply. I have done that, and it still not working. I still get the same error after I change the tables’ collation and make them all same.
    This is a strange issue.
    Thanks,
    Darren

    Plugin Author Shea Bunge

    (@bungeshea)

    It looks like changing the table collation is not enough; you need to change the collation for the individual columns – at least, for the code column.

    I was able to reproduce this and I think I have found a fix for it, by specifying a collation in the query itself. I’ve just released version 2.9.1; please try it out and let me know if it fixes things.

    Thread Starter tajenli

    (@tajenli)

    Hi Shea,

    It’s working now! Thank you so much for looking into this issue!!! I really appreciate!

    Darren

    Plugin Author Shea Bunge

    (@bungeshea)

    Thanks for confirming! And I’m sorry that it took me so long to solve this one.

    Thread Starter tajenli

    (@tajenli)

    Consider this is not a simple issue. You fixed it in quite short time.
    Again, thank you so much!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Issue on Multisite with WPML’ is closed to new replies.