• Resolved Bigue Nique

    (@biguenique)


    When activating Loco Translate on a subsite in a multisite network, admin menu Loco Translate >?Languages fails with a WordPress critical error. It is therefore impossible to configure languages for a website in a multisite network.

    Error log shows a bad query:

    <code>2022-12-01 16:18:03.224263 [NOTICE] [3035769] [<MASKED_IP>:52275-Q:5433E50CAFFC43DD-0#<MASKED_DOMAIN>] [STDERR] WordPress database error Unknown column 'meta_id' in 'order clause' for query SELECT blog_id, meta_key, meta_value FROM blog_bp_user_blogs_blogmeta WHERE blog_id IN (12,16) ORDER BY meta_id ASC made by do_action('loco-translate_page_loco-lang'), WP_Hook->do_action, WP_Hook->apply_filters, Loco_mvc_AdminRouter->renderPage, Loco_admin_list_LocalesController->render, get_sites, WP_Site_Query->query, WP_Site_Query->get_sites, _prime_site_caches, update_site_cache, update_sitemeta_cache, update_meta_cache

    My guess is that ORDER BY meta_id should be replaced with ORDER BY meta_key.

    I tried with Loco Translate activated network-wide: no luck, same results.

    • This topic was modified 2 years, 3 months ago by Bigue Nique. Reason: "Bug report" in title
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Bigue Nique

    (@biguenique)

    Worth noting: network has buddypress activated network-wide.

    Plugin Author Tim W

    (@timwhitlock)

    You can see from the stack trace that Loco Translate calls WordPress’s get_sites function in multisite mode. There is nothing in that call that could be responsible for a query error. It uses the default arguments.

    Somewhere during that get_sites() call it looks like WordPress is updating its cache of site metadata, and it seems the error stems from there. I can’t say how or why, but it’s not a bug in my plugin as far as I can see.

    It is therefore impossible to configure languages for a website in a multisite network.

    Not so. The Loco Translate > Languages page is only one view of your data that groups everything by language. You can add new languages etc.. from other admin pages that do not call get_sites.

    Thread Starter Bigue Nique

    (@biguenique)

    Ok, thanks a million for looking into my issue. I’ll investigate further on my side when I get a minute. I’m marking the issue as resolved since it’s not caused by LocoTranslate.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug report : Bad SQL query in multisite (subsite)’ is closed to new replies.