Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

Tagged: 

This topic contains 17 replies, has 3 voices.

Last updated by Bigul 1 year, 8 months ago.

Assisted by: Bigul.

Author Posts
September 30, 2023 at 12:55 pm #14491443

janv-75

I am trying to: view related orders for a WC subscriptions

Link to a page where the issue can be seen: hidden link

I expected to see: A list with orders belonging to a subscription

Instead, I got: an email saying:

Howdy!

WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.

In this case, WordPress caught an error with one of your plugins, WPML Multilingual CMS.

First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.

Please contact your host for assistance with investigating this issue further.

If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.

hidden link

To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.3.1
Active theme: Sweelinq Child (version 3.0)
Current plugin: WPML Multilingual CMS (version 4.6.6)
PHP version 8.1.18

Error Details
=============
An error of type E_ERROR was caused in line 259 of the file /www/new2sweelinq_451/public/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php. Error message: Uncaught TypeError: Illegal offset type in isset or empty in /www/new2sweelinq_451/public/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php:259
Stack trace:
#0 /www/new2sweelinq_451/public/wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php(113): WPML_Element_Translation->maybe_populate_cache(Object(WC_Subscription))
#1 /www/new2sweelinq_451/public/wp-content/plugins/sitepress-multilingual-cms/classes/url-handling/wpml-url-filters.class.php(144): WPML_Element_Translation->get_element_lang_code(Object(WC_Subscription))
#2 /www/new2sweelinq_451/public/wp-includes/class-wp-hook.php(310): WPML_URL_Filters->get_edit_post_link('<em><u>hidden link</u></em>...', Object(WC_Subscription), '')
#3 /www/new2sweelinq_451/public/wp-includes/plugin.php(205): WP_Hook->apply_filters('<em><u>hidden link</u></em>...', Array)
#4 /www/new2sweelinq_451/public/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/wcs-helper-functions.php(71): apply_filters('get_edit_post_l...', '<em><u>hidden link</u></em>...', Object(WC_Subscription), '')
#5 /www/new2sweelinq_451/public/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/admin/class-wc-subscriptions-admin.php(1517): wcs_get_edit_post_link(Object(WC_Subscription))
#6 /www/new2sweelinq_451/public/wp-includes/class-wp-hook.php(310): WC_Subscriptions_Admin::display_renewal_filter_notice('')
#7 /www/new2sweelinq_451/public/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#8 /www/new2sweelinq_451/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#9 /www/new2sweelinq_451/public/wp-admin/admin-header.php(303): do_action('admin_notices')
#10 /www/new2sweelinq_451/public/wp-admin/edit.php(407): require_once('/www/new2sweeli...')
#11 {main}
  thrown

Hope you can help me out!

October 2, 2023 at 3:43 pm #14499175

Lauren
WPML Supporter since 10/2015

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with first debugging steps or if I can perhaps help with the issue quickly.

Please be sure to make a full backup of your site and database.

Then, go to WPML -> Support -> Troubleshooting.

Look for 'Clean up' and click the following:
- Synchronize posts taxonomies
- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Synchronize local job IDs
- Fix Terms count
- Fix post assignment for translations

After these steps are you still seeing the error?

October 3, 2023 at 2:37 pm #14506079

janv-75

Hi, this did not have any effect.

October 3, 2023 at 5:11 pm #14507637

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. Maybe you are facing this issue because of compatibility conflicts. So to make sure if possible, please do the following steps.

a) Backup your site first[Mandatory]
b) Switch for a moment to a WordPress default theme like 2023
c) Deactivate all the plugins that are not related to WPML, except the required plugins like WooCommerce to reproduce the issue
d) Then check whether the issue exists or not
e) If the issue is gone, activate the plugins as a group of three or four to find which one has an interaction issue
f) Switch back to the original theme of the site

If you have a staging site(a clone copy of the live), you can try these steps there. It will help to troubleshoot the bug without affecting the live site.

--
Thanks!

Bigul

October 6, 2023 at 12:39 pm #14528049

janv-75

Hi,

I disabled all plugins except Duo Two-Factor Authentication, Limit Login Attempts Reloaded, Maintenance Redirect, Woo Subscriptions, WooCommerce, WPML Multilingual CMS, WPML Sticky Links and WPML String Translation.
Switched to 2023 theme.

Issue stays the same. I however do not get email from staging so cannot check the exact error email. The front-end remains empty, just like it was on production.

Kind regards, Jan

October 6, 2023 at 5:15 pm #14530495

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Jan,

Thank you for the updates. Please share the following details for tracking this issue.

1) Let us know the exact steps to reproduce the issue on your site

2) Fill the private details fields(including FTP details) after a full site backup{mandatory}. I would like to access the admin area of your site for further checking. Refer to the following links for more details about our private information-sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

--
Thanks!

Bigul

October 7, 2023 at 5:07 am #14531885

janv-75

Steps to reproduce issue:
Go to Woocommerce --> subscriptions. Click on the most right column of any subscription which contains the amount of orders associated with that subscription.

October 7, 2023 at 3:33 pm #14533091

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Jan,

Thank you for the details and login information. I can reproduce the issue and the same error is logged after enabling the WordPress Debug mode.

This requires more testing. Please allow me to make a duplicator copy of your site using the Duplicator plugin(https://wordpress.org/plugins/duplicator/) for debugging the issue on my local server. So we can troubleshoot the issue without affecting your sites.

--
Thanks!

Bigul

October 7, 2023 at 5:43 pm #14533207

janv-75

No problem, looking forward to your response.
Thanks!

Kind regards, Jan

October 9, 2023 at 9:13 am #14537363

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Jan,

Thank you for the permission. I made a copy of the site using the Duplicator Pro plugin. Because the Duplicator free version was showing a *Host Build Interrupt* error. Please check the attached image for more details.

We will debug it further locally and get back to you as early as possible. Please wait.

--
Thanks!

Bigul

2023-10-09_14h36_48.png
October 10, 2023 at 4:24 pm #14552507

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Jan,

The bug exists in my local copy after initial troubleshooting steps. So consulting with our team for the expert opinion. We will get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

October 11, 2023 at 5:19 pm #14561169

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Jan,

Have you changed the password of the staging site - hidden link. We are unable to log in now. Please check. Enabling the private option for the next reply.

--
Thanks!

Bigul

October 13, 2023 at 9:39 am #14571685

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Jan,

Thank you for the updated credentials. I have shared it with our team for further checking. We will get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

October 17, 2023 at 8:15 am #14590975

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Jan,

The error is escalated to our developer for further debugging and fixing. But we have a workaround for this bug. Please try the following steps after a full site backup and let us know your feedback.

1) Go to *wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/* folder
2) Open *wcs-helper-functions.php* file for edit
3) Scroll down to the line 64
4) Make the following changes and save the file

From

function wcs_get_edit_post_link( $post_id ) {
	$object = wc_get_order( $post_id ); // works for both WC Order and WC Subscription objects.

	if ( ! $object || ! in_array( $object->get_type(), array( 'shop_order', 'shop_subscription' ), true ) ) {
		return;
	}

	return apply_filters( 'get_edit_post_link', $object->get_edit_order_url(), $post_id, '' );
}

To

function wcs_get_edit_post_link( $post_id ) {
	if ($post_id instanceof('WC_Subscription')){
		$post_id = $post_id->id;
		}
	$object = wc_get_order( $post_id ); // works for both WC Order and WC Subscription objects.

	if ( ! $object || ! in_array( $object->get_type(), array( 'shop_order', 'shop_subscription' ), true ) ) {
		return;
	}

	return apply_filters( 'get_edit_post_link', $object->get_edit_order_url(), $post_id, '' );
}

We will get back to you soon when we have an update from our developers. Please wait.

--
Thanks!

Bigul

October 17, 2023 at 8:27 am #14591245

janv-75

Hi,

Thanks for this fix. Since it is not very urgent to us and does not affect the core functionality, we will just wait for an official fix to be released. Hope to hear from you soon!

Kind regards, Jan