Background of the issue:
I am trying to add a translation in Spanish to a product created in English. This product has Toolset relationships with other custom post types. The issue can be seen at the following link: hidden link
Symptoms:
I expected to see the Spanish translation created, but instead, I got a PHP Fatal error: There has been a critical error on this website. The error message is:
Fatal error: Uncaught InvalidArgumentException in /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/RelationshipQuery/Condition/type.php:28 Stack trace: #0 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/RelationshipQuery/condition_factory.php(88): Toolset_Relationship_Query_Condition_Type->__construct() #1 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/RelationshipQuery/RelationshipQuery.php(439): Toolset_Relationship_Query_Condition_Factory->has_type() #2 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/RelationshipQuery/RelationshipQuery.php(425): OTGSToolsetCommonRelationshipsDatabaseLayerRelationshipQueryRelationshipQuery->has_domain_and_type() #3 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/Version2/Persistence/WpmlTranslationUpdate/WpmlTranslationUpdateHandler.php(186): OTGSToolsetCommonRelationshipsDatabaseLayerRelationshipQueryRelationshipQuery->has_domain_and_type() #4 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/Version2/Persistence/WpmlTranslationUpdate/WpmlTranslationUpdateHandler.php(105): OTGSToolsetCommonRelationshipsDatabaseLayerVersion2PersistenceWpmlTranslationUpdateWpmlTranslationUpdateHandler->one_element_action() #5 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/MainController.php(377): OTGSToolsetCommonRelationshipsDatabaseLayerVersion2PersistenceWpmlTranslationUpdateWpmlTranslationUpdateHandler->on_wpml_translation_update() #6 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-includes/class-wp-hook.php(324): OTGSToolsetCommonRelationshipsMainController->{closure:OTGSToolsetCommonRelationshipsMainController::add_hooks_when_active():369}() #7 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #8 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-includes/plugin.php(517): WP_Hook->do_action() #9 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php(190): do_action() #10 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php(79): WPML_Set_Language->change_translation_of() #11 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1533): WPML_Set_Language->set() #12 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1414): SitePress->set_element_language_details() #13 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-job-factory.php(112): TranslationManagement->send_jobs() #14 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php(164): WPML_Translation_Job_Factory->create_local_job() #15 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php(43): WPMLTMJobsManual->createLocalJob() #16 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPMLTMJobsManual->createOrReuse() #17 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/classes/editor/Editor.php(103): WPMLFPRight->map() #18 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-queue/class-wpml-translations-queue.php(52): WPMLTMEditorEditor->open() #19 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-includes/class-wp-hook.php(324): WPML_Translations_Queue->load() #20 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #21 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-includes/plugin.php(517): WP_Hook->do_action() #22 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-admin/includes/class-wp-screen.php(424): do_action() #23 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-admin/includes/screen.php(243): WP_Screen->set_current_screen() #24 /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-admin/admin.php(213): set_current_screen() #25 {main} thrown in /var/www/vhosts/sadev.com/httpdocs/www.sadev.com/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/RelationshipQuery/Condition/type.php on line 28
Questions:
How can I resolve the PHP Fatal error when adding a translation in Spanish?
Is there a compatibility issue between WPML and Toolset CRED forms?
Could you please ensure that the Toolset Forms plugin, as well as the WPML plugins, are in their latest versions?
If not, please update all of our plugins and see if that resolves the issue.
If it doesn't help, after consulting our second-tier supporter about it, we also want you to check if the problem persists when temporarily deactivating the Toolser Forms plugin. Does the error occur when the Toolset Forms plugin is deactivated?
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
If you still need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply. Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ **IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--
Thanks for trying my suggestion and sharing the access to your site. However, it is unclear to me if you have tried the suggestion to temporarily deactivate the Toolset Forms plugin and check if the fatal error still occurs. While I'm waiting for your answer, I'm also consulting our second-tier supporters about this problem. I'll update you once I get a reply from them.
OK, I understand. Please allow me to take a copy of your site. For this, I must install a plugin like Duplicator or All In One Migration. Please let me know if you agree.
Please note that my weekend hours are Friday to Saturday. If you need further assistance, I'll be available to continue checking this issue and helping you next week.