This thread is resolved. Here is a description of the problem and solution.
Problem:
When sending page for translation via Translation management I get an error:
"(12) Invalid state 'translating' to complete operation"
Solution:
There was an issue with Redis cache which creates objects from WordPress content which doesn't work well with WPML Translation Management. Fixed in the next release.
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.
This topic is split from https://wpml.org/forums/topic/translations-are-incorrectly-transmitted-to-icanlocalize-php-warnings/
This topic contains 17 replies, has 2 voices.
Last updated by Dražen Duvnjak 4 years, 4 months ago.
Assisted by: Dražen Duvnjak.
Author | Posts |
---|---|
May 16, 2020 at 5:59 am #6145773 | |
Dan |
Hi Drazen, Warning: A non-numeric value encountered in /var/www/vhosts/dev3.internetsociety.org/wp-content/plugins/wpml-translation-management/inc/translation-proxy/translationproxy-basket.class.php on line 132 Warning: A non-numeric value encountered in /var/www/vhosts/dev3.internetsociety.org/wp-content/plugins/wpml-translation-management/inc/translation-proxy/translationproxy-basket.class.php on line 132 and this one: Sending your jobs to professional translation (12) Invalid state 'translating' to complete operation Rollback jobs... Batch rolled back So this is working now, but only if redis cache is cleared. As this isn't very convenient for editors, I would like to implement a mechanism that clears redis cache. I see there is this contant that can be used: define( 'WP_REDIS_IGNORED_GROUPS', [ Any idea if a "wpml" parameter exists for redis cache? |
May 16, 2020 at 6:08 am #6145779 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hi Dan, I think this issue happens since Redis cache creates objects from WordPress content which doesn't work with WPML. I think we should try and find a fix for this issue since Redis is quite a popular server cache plugin. Can you try adding WPML_TM_ICL_Translations::translations to the WP_REDIS_IGNORED_GROUPS array. Let me know how it goes. Thanks and regards, |
May 22, 2020 at 7:04 am #6192711 | |
Dan |
Hi Drazen, Sorry it took us a bit of time to test this. My colleague in charge of translations tested and it still doesn't work. Here is the config I specified in the wp config: define('WP_REDIS_IGNORED_GROUPS', [ Here is the testing scenario: - he sent one article off to translation. Can you check and advise? Best, |
May 22, 2020 at 7:57 am #6193081 | |
Dan |
Hi Drazen, |
May 22, 2020 at 8:31 am #6193257 | |
Dan |
Hi Drazen, And a few php notices I bumped into on one of my dev sites: Notice: Undefined index: wpml_cf_preferences in /app/public/wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php on line 57 On pages such as: Probably not vital but always good to eradicate. Thanks, |
May 22, 2020 at 11:34 am #6194995 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello Henri, thanks for sharing. That is weird, it worked before with the same issues. Can you please confirm it works fine after clearing Redis cache or when Redis cache disabled? In order to investigate this issue and to understand it better, I would need to access your website. Please share a page that I can use and that is causing this issue. Best would be some small test page with 1-2 sentences. Please make a full backup of your site (files and database) and confirm it in your next reply. I might need to enable/disable plugins, switch themes and access your website database. I would need to access both your site's wp-admin and FTP account. Be sure to provide both. I have enabled the private username and password fields in your next reply. I suggest you create a temporary user, set it as an administrator and then add those credentials in the private fields mentioned. You can safely add your information into these fields. Thanks, |
May 23, 2020 at 10:42 am #6200803 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for the staging site and information. It really helped me understand the issue and investigating it. I have logged in to your staging site, checked the issue, and tried with different pages and with all other plugins disabled except for WPML plugins and Redis while using the WP default theme. The issue still exists, it worked only after clearing the cache or when sending it to a local translator. Then I set up a sandbox on our servers and was able to replicate the issue on a clean install. That confirms there are compatibility issues. That being the case I have escalated this ticket to our compatibility team and they will be checking the issue and hopefully provide a solution. I will be marking this ticket status as Escalated to Compatibility team and will update you as soon as I have some news. Thank you for your patience. Enjoy your weekend too, and talk to you soon. Regards, |
June 5, 2020 at 8:50 am #6302733 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I have an update from our developers. Can you please try adding "TranslationProxy_Project" to WP Redis Ignored group to wp-config.php: It should look something like this: define('WP_REDIS_IGNORED_GROUPS', [ "counts", "plugins", "themes", "options", "WPML_TM_ICL_Translations::translations", "TranslationProxy_Project", ]); Please let me know how it goes and if it works for you. Thanks, |
June 8, 2020 at 9:32 am #6319403 | |
Dan |
Hi Drazen, It looks like it still doesn't work. I have tried as indicated with the following parameters: define('WP_REDIS_IGNORED_GROUPS', [ Steps to reproduce: What do you think, should we try Redis Cache Pro? hidden link Let me know, |
June 8, 2020 at 2:29 pm #6322433 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for the reply. If you have that ability it would be nice if you can check with some other Redis plugins, since on our test site we managed to fix the issue with Redis Object cache by adding the mentioned code. But your environment might be different, and it is not working on your side. I will forward your reply to our developers, to see if they can debug this any further and suggest a different fix. Thanks, |
June 8, 2020 at 5:32 pm #6323913 | |
Dan |
Hi Drazen, I have been able to find a work around to fix this with a small plugin, see below. object cache is flushed as soon as I am on a translation management page. /* function isoc_flush_cache_wpml() { global $wp_object_cache; endif; if (is_admin() ) { |
June 8, 2020 at 6:37 pm #6324143 | |
Dan |
Hi again, Warning: A non-numeric value encountered in /var/www/vhosts/dev3.internetsociety.org/wp-content/plugins/wpml-translation-management/inc/translation-proxy/translationproxy-basket.class.php on line 133 And this leads finally to translationproxy-basket.class.php Obviously, there is a variable that cannot be counted that should not be considered in such a case. Best, |
June 9, 2020 at 6:42 am #6327277 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, thanks for sharing. 1) Would be nice if wpml could solve that for everyone. That Redis object caching plugin seems to be widely used. We agree we are looking into a new way how to implement a permanent fix in our plugins, so these issues don't happen anymore. 2) Obviously, there is a variable that cannot be counted that should not be considered in such a case. It is a source of the issue, Redis converts these pages/jobs to object, then when WPML tries to send and read them it can't since it is an object (not excepted) and gives back an error. That is why we are looking into a way to have these things ignored from caching, they shouldn't be cached in order to work correctly with WPML. I am sharing your information with our developers, thanks for getting back. I will update you soon. Thanks, |
June 18, 2020 at 12:10 pm #6403317 | |
Dražen Duvnjak Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I bring good news, our developers were able to isolate and fix the issue. A permanent fix will be most probably included in WPML 4.3.16 version. I will be updating you once the version is available for public download. Thank you for your collaboration and patient. Regards, |
June 18, 2020 at 12:13 pm #6403331 | |
Dan |
Hi Drazen, Good to hear! I will watch out for the next version. Thanks very much for your great support! Henri |