Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 1.44 hours from now. Thank you for your understanding.

We have a longer than usual waiting time. Please make sure to check out the Known Issues page and Minimum Requirements before reporting any issue.
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 -

Supporter timezone: Europe/Paris (GMT+01:00)

This topic contains 51 replies, has 3 voices.

Last updated by George Botsev 6 years, 1 month ago.

Assisted by: Yvette.

Author Posts
September 25, 2018 at 12:35 pm #2763741

Václav

Hello,
thanks for the update! I tested this on the kellyxir.cz site (same multisite, same login details).

I activated the HyperDB Multilingual plugin, and tried to submit a new translation job to a translator. That worked fine, as admin, I can see the Job as Waiting for translator.

The translator did get the "You have been assigned to new translation job" email, but when I login as the translator, I don't see any jobs in the Translations section.

Am I missing something?

Thanks
Vaclav Greif

September 25, 2018 at 12:54 pm #2763837

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Hello

The plugin is there to address a particular issue of the translator_id being blank. Could you confirm that you are no longer getting errors when creating a duplicate?

The other issue will need to be addressed separately for the moment.
Thanks

September 25, 2018 at 2:22 pm #2764239

Václav

Hello,
yes, I can confirm that assigning a translation job to a translator works now without DB errors.

The remaining issue is, that the translator doesn't see the assigned translation under his account.

Thanks!
V.

September 25, 2018 at 2:28 pm #2764251

Václav

This is probably due to this db error:

[code]
[25-Sep-2018 14:18:52 UTC] WordPress database error Table 'yotlix.mw_625_posts' doesn't exist for query SELECT DISTINCT mw_users.ID FROM mw_users LEFT JOIN mw_usermeta ON ( mw_users.ID = mw_usermeta.user_id ) LEFT JOIN mw_usermeta AS mt1 ON ( mw_users.ID = mt1.user_id ) LEFT JOIN mw_usermeta AS mt2 ON ( mw_users.ID = mt2.user_id ) LEFT JOIN mw_usermeta AS mt3 ON (mw_users.ID = mt3.user_id AND mt3.meta_key = 'wpseo_noindex_author' ) LEFT JOIN mw_usermeta AS mt4 ON ( mw_users.ID = mt4.user_id ) WHERE 1=1 AND mw_users.ID<>1 AND mw_users.ID IN ( SELECT DISTINCT mw_625_posts.post_author FROM mw_625_posts WHERE mw_625_posts.post_status = 'publish' AND mw_625_posts.post_type IN ( 'post', 'page', 'attachment', 'mw-portfolio' ) ) AND (
(
(
mw_usermeta.meta_key = '_yoast_wpseo_profile_updated'
AND
(
( mt1.meta_key = 'mw_625_user_level' AND mt1.meta_value != '0' )
AND
(
( mt2.meta_key = 'wpseo_noindex_author' AND mt2.meta_value != 'on' )
OR
mt3.user_id IS NULL
)
)
)
AND
(
mt4.meta_key = 'mw_625_capabilities'
)
)
) ORDER BY mw_usermeta.meta_value+0 DESC
[/code]

September 25, 2018 at 7:51 pm #2765152

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Ok. I am asking if we should create a new ticket for the issue of if we can still work off of this one. Please be patient until I get a response.

September 25, 2018 at 8:34 pm #2765222

Václav

Hello Yvette,
no need to open another ticket, let's stick with this one..:)

Thanks!
V.

September 26, 2018 at 6:40 am #2766011

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

I have the agreement of 2nd tier to continue with this ticket here.

With regards to the translator not being able to see the jobs assigned to them:

1.Is this for new products? or only for old products?
2.Which user?
3.Can you provide the user credentials to be able to see their translation dashboard? (I am opening the private area for this)

4. Please provide steps to replicate this on your system (be detailed).

Thanks

September 26, 2018 at 8:50 am
September 26, 2018 at 9:38 am #2766651

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Thanks - I´ve passed the information along.

September 27, 2018 at 8:43 am #2769824

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Hello, I am George from second tier support.
I am investigating the problem with our developers.
They have asked me if you can provide the whole stack trace of that database error.
I reproduced the error on your site, and I see that the problem is that it seeks for the users table in the current database, however, because your database is fragmented between multisites, the users table is actually in your main database, and thus an error happens.

So we need one of the two options here:
- Full stack trace dump of the database errror - I tried to get that, but nothing was logged in the debug log of your site, after I enabled debugging - so perhaps you can help me there?
OR
- A full copy of your site OR a staging environment where we can do all sort of tests and modifications freely - that might be destructive to data.

Currently, based on the data that we have of the error and of the structure of your site, this looks to us like a conflict with your custom code - that fragments the multisite database into multiple databases.

September 27, 2018 at 10:56 am #2770215

Václav

Hello,
thanks for debugging this. Due to the large size of the multisite install there sadly is no easy way to gice you the full copy or create a one-to-one staging environment.

Please, provide me your IP address, I'll add it to the list of allowed IP's to access the log and will provide you the information how to get to the error log.

I use HyperDB in a pretty simple scenario, just to split the site's dbs after each 100 sites. Here's the function that takes care of that:

	// Multisite blog tables are "{$base_prefix}{$blog_id}_*"
    if ( preg_match("/^{$wpdb->base_prefix}(\d+)_/i", $wpdb->table,$matches) && strpos($wpdb->table, '_slim_') === false ) {
        if (isset($matches[1])) {
            $db_id = intval($matches[1] / 100);
            if ($db_id) {
                return 'yotlix_' . $db_id;
            }
        }
    }

Let me know if you need anything else, I'll be happy to provide you more details.

Thanks!
Vaclav

September 27, 2018 at 11:30 am #2770293

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Yes, I noticed that code, and that is exactly the source of the problem.
Your main database is X, but the subsite database is X_Number_
So we search because it is a multisite in the current database, but in the current database, the table "users" is not present - and because of that - there is no results to be displayed in the translation queue.
This is not a standard setup and not according to the WordPress and HyperDB usage standards.
My IP address is dynamic, so perhaps it would be better if you can just provide the logs after reproducing the error - e.g. visiting the translation queue with the translation user.
Another suggestion for your code, perhaps you can detect when the users tables are being accessed, and rewrite the query to suit your needs as you already do for other requests - as I told you in my previous reply - this is a custom coding scenario that we cannot support.

My current IP address is: 188.254.152.213, but this can change as I have no static address.

September 27, 2018 at 11:40 am #2770340

Václav

Hello George,
thanks. To make this more clear:
- the HyperDB setup is actually a standard one and this is exactly what HyperDB is used for: the code I'm using is similar to the one in the example db-config http://plugins.svn.wordpress.org/hyperdb/trunk/db-config.php
- HyperDB adjusts the $wpdb object - as long as you use the WP API, everything should work just fine - $wpd->prefix, $wpdb->users etc., all of this should work just fine, and there's no reason to be guessing what the DB should be, it's being adjusted automatically

The error is this one:

[27-Sep-2018 11:39:19 UTC] WordPress database error Table 'yotlix_6.mw_users' doesn't exist for query 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_users u
                      ON s.translator_id = u.ID
                    WHERE  s.status > 0 AND s.status <> 9 AND (j.translator_id = 98 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'))  OR  (t.source_language_code = 'en' AND t.language_code IN ('cs')) ) 
                      AND iclt.field_type = 'original_id'
                 made by WPML_Translation_Job_Factory::get_translation_job_types_filter
September 27, 2018 at 11:45 am #2770360

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Thank you for your feedback.
I will forward the error message and your response to our developers and they will take another look at the code that is responsible for this.
As soon as we have something, either me or my colleague Yvette will bring you up to speed with the progress.

September 27, 2018 at 11:49 am #2770364

Václav

Ok, I debugged this more and can see what the issue is, it's this code, where the joined users table obviously doesn't exist.

		$job_types = $wpdb->get_results( "SELECT DISTINCT
				    SUBSTRING_INDEX(ito.element_type, '_', 1) AS element_type_prefix,
				    ito.element_type AS original_post_type
                    FROM " . $this->get_table_join() . "
                    LEFT JOIN {$wpdb->prefix}posts p
                      ON t.element_id = p.ID
                    LEFT JOIN {$wpdb->users} u
                      ON s.translator_id = u.ID
                    WHERE {$where}
                      AND iclt.field_type = 'original_id'
                " );

Any chance to rewrite this to get the user details in another query?