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.

Author Posts
February 8, 2019 at 9:24 pm #3177107

mathieuS-13

I am trying to:
Add a translation for a Genesis Simple FAQ

Link to a page where the issue can be seen:
It can't be seen from the public, only when attempting to create a translation.

I expected to see:
The translation page.

Instead, I got:
Notice: Trying to get property of non-object in /www/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-composite-products.php on line 562 Fatal error: Uncaught Error: Call to a member function apply_rounding_rules() on null in /www/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-composite-products.php:562 Stack trace: #0 /www/wp-includes/class-wp-hook.php(286): WCML_Composite_Products->apply_rounding_rules(100) #1 /www/wp-includes/plugin.php(203): WP_Hook->apply_filters(100, Array) #2 /www/wp-content/plugins/woocommerce/includes/wc-formatting-functions.php(558): apply_filters('raw_woocommerce...', 100) #3 /www/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-component.php(1121): wc_price(100) #4 /www/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-rest-api.php(241): WC_CP_Component::get_price_display_options() #5 /www/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-rest-api.php(388): WC_CP_REST_API::get_extended_product_schema() #6 /www/wp-content/plugins/woocommerce-composite-products/includes/class-wc-cp-rest-api.php(92): WC_CP_REST_API::get_product_field_schema('comp in /www/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-composite-products.php on line 562

February 8, 2019 at 9:57 pm #3177190

mathieuS-13

I've narrowed it down to the WooCommerce Multilingual plugin that is causing this issue. Ever since it was updated, my entire site is riddled with this error or similar.

February 8, 2019 at 10:05 pm #3177196

mathieuS-13

I also noticed that the code in question here is:

public function apply_rounding_rules( $price ) {
		return $this->woocommerce_wpml->multi_currency->prices->apply_rounding_rules( $price );
	}

But I don't have multi-currency turned on... so I'm not sure why this causing an issue all of a sudden?

February 9, 2019 at 9:38 pm #3178784

mathieuS-13

I'm seeing other complains around the forums that might be related to my issue. Others have gotten a response before me and they posted far later than I did. Could someone please look into this crucial bug?

February 11, 2019 at 9:56 am #3181892

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for contacting WPML Support. I will be glad to help with this.

Our developers are working on this issue, and we will be pushing a fix very soon.
I am sorry to hear that other clients have posted this after and have been replied to faster, we always try to serve the first one first.

I will come back to you as soon as possible.

Best regards,
Jamal
WPML Support

February 11, 2019 at 10:00 am #3181931

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

As a workaround you can edit manually the file compatibility/class-wcml-composite-products.php in WooCommerce Multilingual around line 562.
Change this line:

		return $this->woocommerce_wpml->multi_currency->prices->apply_rounding_rules( $price );

With this:

		if ( wcml_is_multi_currency_on() ) {
			$price = $this->woocommerce_wpml->multi_currency->prices->apply_rounding_rules( $price );
		}

		return $price;

Let me know if this resolve the issue.

Best regards,
Jamal
WPML Support

February 11, 2019 at 1:11 pm #3183023

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

This fix have been merged with our code and will be released very soon. I marked this ticket as fixed in next release. I will inform you once it is published to check if the issue is resolved.

Thank you for your patience.

Best regards,
Jamal
WPML Support

February 11, 2019 at 8:03 pm #3185308

mathieuS-13

Sorry, but after applying the fix above, now I see the following within the alternate language column:

Notice: Undefined offset: 540 in /www/wp-content/plugins/wpml-translation-management/classes/filters/class-wpml-tm-translation-status-display.php on line 242 Notice: Undefined offset: 540 in /www/wp-content/plugins/wpml-translation-management/classes/filters/class-wpml-tm-translation-status-display.php on line 243 
February 12, 2019 at 7:11 pm #3190492

mathieuS-13

This release was slated for Monday, but it is now Tuesday where I live. Is there any update? This is having a negative affect on my business...

February 13, 2019 at 8:07 am #3192431

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

My apologies for any inconvenience. We have published the new version WPML 4.2.1, this includes un update to WooCommerce Multilingual, see our announcement.
https://wpml.org/2019/02/wpml-4-2-1-with-stability-improvements-and-bug-fixes/

Please update WPML plugins to latest release, and let me know if it resolves this issue.

Best regards,
Jamal
WPML Support

The topic ‘[Closed] 500 Error When Attempting To Create Translation’ is closed to new replies.