Skip to content Skip to sidebar

Resolved

Reported for: WooCommerce Multilingual & Multicurrency 5.5.0

Resolved in: WooCommerce Multilingual & Multicurrency 5.5.1

Topic Tags: Compatibility, WCML

Overview of the issue

When using WooCommerce Multilingual with WPML, you might experience the following fatal error when saving product translations using the native WordPress editor:

PHP Fatal error: Uncaught TypeError: Cannot access offset of type WP_Post in isset or empty in .../wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php:282

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/plugins/woocommerce-multilingual/classes/Synchronization/Hooks.php file.
  • Look for line 184.
  • Replace:
    $originalLanguage = $this->manager->getElementLanguage( $originalProduct );
            
  • With:
    $originalLanguage = $this->manager->getElementLanguage( $originalProduct->ID );