 Václav
|
Hello,
I tested this now. When I submit the translation to the user, I don't see any db errors, but when I come to the "Translations" screen, I see following error (again, trying to read users table from wrong db ):
SELECT DISTINCT SUBSTRING_INDEX(ito.element_type, '_', 1) AS element_type_prefix, ito.element_type AS original_post_type
FROM mw_625_icl_translate_job j JOIN mw_625_icl_translation_status s
ON j.rid = s.rid JOIN mw_625_icl_translations t
ON s.translation_id = t.translation_id JOIN mw_625_icl_translate iclt
ON iclt.job_id = j.job_id JOIN mw_625_icl_translations ito
ON ito.element_id = iclt.field_data
AND ito.trid = t.trid JOIN (SELECT rid, MAX(job_id) job_id
FROM mw_625_icl_translate_job
GROUP BY rid ) jobmax
ON ( j.revision IS NULL
AND j.rid = jobmax.rid)
OR ( j.job_id = jobmax.job_id
AND j.translated = 1)
LEFT JOIN mw_625_posts p
ON t.element_id = p.ID
LEFT JOIN mw_625_users u
ON s.translator_id = u.ID
WHERE s.status > 0
AND s.status <> 9
AND (j.translator_id = 1
OR j.translator_id = 0
OR j.translator_id IS NULL )
AND s.translation_service='local'
AND ( (t.source_language_code = 'cs'
AND t.language_code IN ('en')) )
AND iclt.field_type = 'original_id'
|
 George Botsev
WPML Supporter since 02/2014
Languages:
English (English )
Timezone:
Europe/Sofia (GMT+02:00)
|
I checked this. Yes you are correct - there is still error.
I did an adjustment, replaced "prefix" with "base_prefix" as this should be the multi-site variant for handling similar cases.
However, this still does not work, as your multisite setup is split in two databases and the users database is in the "yotix" database, but all other sites are in the "yotix_" database.
At this time, I can only suggest that you hardcode this wherever necessary.
changing the line
LEFT JOIN {$wpdb->base_prefix}users u
to:
LEFT JOIN yotlix.{$wpdb->base_prefix}users u
|
 Václav
|
Hello,
thanks. I think I resolved this. Diving deeper into wpdb class, I found out that the users table can be easily overriden globally. I reverted the changes back to
and defined in wp-config.php
define('CUSTOM_USER_TABLE','yotlix.mw_users');
DB errors are gone, I can see the waiting translations in the dashboard. Any possible issues with this solution?
Thanks!
V.
|
 George Botsev
WPML Supporter since 02/2014
Languages:
English (English )
Timezone:
Europe/Sofia (GMT+02:00)
|
That is an awesome workaround that you found.
I am not familiar with that function of the wpdb class, but I am going to ask our developers.
Have you tested if you leave the prefix too if it is working?
If it works that way too - then perhaps everything will be just fine in my opinion...
|
 Václav
|
Hello,
i found out that I broke the wp_insert_user function by this workaround, as it tries to find table
I'll debug this more..:)
|
 Yvette
Supporter
Languages:
English (English )
Spanish (Español )
Timezone:
Europe/Paris (GMT+01:00)
|
|
 George Botsev
WPML Supporter since 02/2014
Languages:
English (English )
Timezone:
Europe/Sofia (GMT+02:00)
|
That is strange.
Do you have any custom functions that are hooking onto the user creation perhaps?
Yes - this would require a very serious debugging, and it could be coming from WordPress core itself.
|