Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client encountered a critical error when trying to create a root page using the 'Use directory for default language' option in WPML. The error was related to the translation_priority taxonomy and a specific post with ID 38470.
Solution:
We recommended a minimal setup test to identify the issue:
1. Temporarily switch to the Twenty Twenty-Five theme.
2. Deactivate any object cache like Redis or Memcached.
3. Keep only WPML Multilingual CMS and WPML String Translation active.
4. Attempt to recreate the root page.
If successful, gradually re-enable the theme and plugins to pinpoint the conflict. Additionally, use WPML's Troubleshooting Tools by navigating to WPML → Support → Troubleshooting and running the following:
- Set language information
- Remove ghost entries from the translation tables
- Fix element_type collation
Finally, go to Settings → Permalinks and click Save. It's crucial to make a full site backup before proceeding with these steps, especially if the site is live. Consider performing these actions in a staging environment.

If the problem persists or the solution seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket for further assistance at WPML support forum.

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.

Tagged: 

This topic contains 2 replies, has 0 voices.

Last updated by operationM 1 month, 3 weeks ago.

Assisted by: Itamar.

Author Posts
September 14, 2025 at 2:37 pm #17400039

operationM

Background of the issue:
I am trying to add the language code into the URL, such as /int/home or /fr/home, by using the 'Use directory for default language' option and creating a root page. I encountered a critical error when attempting to create the page. Here is the link to the page where the issue can be seen: hidden link.
The two root pages are created as they are listed under pages but neither are being used when going back to the languages page.

Symptoms:
Error Details
=============
An error of type E_ERROR was caused in line 657 of the file
/home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php.
Error message: Uncaught Error: Cannot use object of type WP_Error as
array in /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php:657
Stack trace:
#0 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Logic.php(63):
WPML_Terms_Translations::{closure:WPML_Terms_Translations::createTerm():652}(Array)
#1 [internal function]:
WPMLFPLogic::{closure:WPMLFPLogic::init():62}(Object(Closure),
Object(Closure), Object(Closure), Array, 0)
#2 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154):
call_user_func_array(Object(Closure), Array)
#3 [internal function]: {closure:{closure:WPMLFPcurryN():136}:137}(Array, 0)
#4 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Collection.php(603):
array_map(Object(Closure), Array, Array)
#5 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php(574):
WPMLCollectSupportCollection->map(Object(Closure))
#6 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php(524):
WPML_Terms_Translations::quick_edited_post_terms(38470,
'translation_pri...', Array)
#7 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translations.class.php(502):
WPML_Terms_Translations::set_tags_in_proper_language(38470, Array,
'translation_pri...', Array)
#8 /home/wp_ftba6z/marwal159.dream.press/wp-includes/class-wp-hook.php(324):
WPML_Terms_Translations::set_object_terms_action(38470, Array, Array,
'translation_pri...', false, Array)
#9 /home/wp_ftba6z/marwal159.dream.press/wp-includes/class-wp-hook.php(348):
WP_Hook->apply_filters(NULL, Array)
#10 /home/wp_ftba6z/marwal159.dream.press/wp-includes/plugin.php(517):
WP_Hook->do_action(Array)
#11 /home/wp_ftba6z/marwal159.dream.press/wp-includes/taxonomy.php(2966):
do_action('set_object_term...', 38470, Array, Array,
'translation_pri...', false, Array)
#12 /home/wp_ftba6z/marwal159.dream.press/wp-includes/post.php(5654):
wp_set_object_terms(38470, Array, 'translation_pri...', false)
#13 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-post-actions.class.php(243):
wp_set_post_terms(38470, Array, 'translation_pri...')
#14 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-post-actions.class.php(52):
WPML_TM_Post_Actions->save_translation_priority(38470)
#15 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php(941):
WPML_TM_Post_Actions->save_post_actions(38470, Object(WP_Post), false)
#16 /home/wp_ftba6z/marwal159.dream.press/wp-includes/class-wp-hook.php(324):
wpml_tm_save_post(38470, Object(WP_Post), false)
#17 /home/wp_ftba6z/marwal159.dream.press/wp-includes/class-wp-hook.php(348):
WP_Hook->apply_filters('', Array)
#18 /home/wp_ftba6z/marwal159.dream.press/wp-includes/plugin.php(517):
WP_Hook->do_action(Array)
#19 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-translation.class.php(213):
do_action('wpml_tm_save_po...', 38470, Object(WP_Post), false)
#20 /home/wp_ftba6z/marwal159.dream.press/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-admin-post-actions.class.php(123):
WPML_Post_Translation->after_save_post(false, Array, 'int', NULL)
#21 /home/wp_ftba6z/marwal159.dream.press/wp-includes/class-wp-hook.php(326):
WPML_Admin_Post_Actions->save_post_actions('38470', Object(WP_Post))
#22 /home/wp_ftba6z/marwal159.dream.press/wp-includes/class-wp-hook.php(348):
WP_Hook->apply_filters(NULL, Array)
#23 /home/wp_ftba6z/marwal159.dream.press/wp-includes/plugin.php(517):
WP_Hook->do_action(Array)
#24 /home/wp_ftba6z/marwal159.dream.press/wp-includes/post.php(5110):
do_action('save_post', 38470, Object(WP_Post), true)
#25 /home/wp_ftba6z/marwal159.dream.press/wp-includes/post.php(5212):
wp_insert_post(Array, false, true)
#26 /home/wp_ftba6z/marwal159.dream.press/wp-admin/includes/post.php(453):
wp_update_post(Array)
#27 /home/wp_ftba6z/marwal159.dream.press/wp-admin/post.php(227): edit_post()
#28 {main}
thrown

Questions:
How can I fix the critical error when creating a root page with the 'Use directory for default language' option?

September 15, 2025 at 9:12 am #17401180

Itamar
WPML Supporter since 02/2016

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I've discussed this issue with our second-tier supporters. They say that, according to the error message, it seems like a problem with the translation_priority taxonomy on your site and post with ID 38470. It does not seem to be a problem with in our code. Here is what we suggest proceeding with.

Minimal setup test

- Switch temporarily to the Twenty Twenty-Five theme.

- Deactivate the object cache (Redis/Memcached, if active).

- Keep only WPML Multilingual CMS and WPML String Translation active.

- Try again to create the root page.

If it works, re-enable your theme and plugins in small batches to identify the conflict.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


If your site is live, consider trying those procedures in a staging environment or by creating a snapshot of your site on your local server or another server. ***

WPML Troubleshooting Tools

- Go to WPML → Support → Troubleshooting and run these:

- Set language information

- Remove ghost entries from the translation tables

- Fix element_type collation

- After running these tools, go to Settings → Permalinks and click Save.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Could you please proceed with the above and tell me what you have found?

Regards,
Itamar.

September 15, 2025 at 6:41 pm #17403761

operationM

Hi Itamar,

Thank you for such a quick response. I did as you suggested regarding disabling all plugins and theme and recreated the default page and it worked.

In future I will do this prior to requesting any support on any issues. My previous issue made me want to submit messages of critical errors to the dev team for quick fixing 🙂

Thank you for your time.

Phil