Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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.

This topic contains 12 replies, has 2 voices.

Last updated by George Botsev 1 month, 3 weeks ago.

Assigned support staff: George Botsev.

Author Posts
August 15, 2019 at 11:23 am #4400425

George L.

Running WPML v4.3.0-b5 we get the following notice on our logs

(
    [type] => 16384
    [message] => Defining the getGlobals() method in the "optimizer" extension without explicitly implementing Twig\Extension\GlobalsInterface is deprecated since version 1.23.
    [file] => /home/gruum/public_html/wp-content/plugins/sitepress-multilingual-cms/lib/twig/src/Environment.php
    [line] => 1301
)
August 15, 2019 at 1:59 pm #4401329

George Botsev
Supporter

Languages: English (English )

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

Hello and thank you for contacting us.
Thank you for testing the latest beta release of WPML plugin.
I wanted to ask you if you have more details on how I can trigger this error.
I suspect that there might be a plugin that is involved here or perhaps some custom code.
Do you have perhaps some steps on how I can test this?

August 15, 2019 at 2:27 pm #4401629

George L.

Hi George,

This seems to fire on most pages using the latest beta version. The latest stable doesn't appear to throw those notices.

We use the following code to debug notices

/**
 * Display the requested page when an error is thrown
 */
add_action( 'shutdown', 'wp_debug_add_url_for_fatal_errors' );
function wp_debug_add_url_for_fatal_errors() {

	// Get the last error
	$a=error_get_last();
    if($a==null) {
		return;
	}

	// Get the requested URL
    $actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "") . (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : "");

	// Record the error URL
    error_log( 'PHP error triggered at: ' . $actual_link );
	error_log( 'PHP error message: ' . print_r( error_get_last(), true ) );
	//error_log(print_r(debug_backtrace(),true));
}

Maybe try this code on your staging and see if it produces the same?

August 15, 2019 at 2:44 pm #4401795

George Botsev
Supporter

Languages: English (English )

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

Thank you for providing this code.
That did it for me.
I am going to escalate this immediately to our developers for their opinion.
Once they respond, I will let you know about the details.

Thank you very much!

August 23, 2019 at 2:34 pm #4448169

George L.

Some further input on this,

There is another type of deprecated notice loading at the same time and is not displayed by the code i sent you previously.

If you install the Query Monitor plugin and navigate to /wp-admin/edit.php?post_type=page (and many other admin pages) then open the "PHP Errors" section, you'll notice there are more deprecated notices regarding "core" and "escaper"

The notices are suppressed which is why they don't come up on the standard debug.log unless you use the code i sent previously.

Using the Query Monitor plugin, will also give you the stack trace for those.

August 26, 2019 at 6:13 am #4456119

George Botsev
Supporter

Languages: English (English )

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

Our developers are aware of that issue. It is coming from the Twig library and they are working on fixing that.
We are also going to phase out gradually Twig usage from our plugins and this will be fixed in future versions of WPML.

September 5, 2019 at 11:19 am #4518751

George L.

Here's another one

(
[type] => 16384
[message] => Using "replace" with character by character replacement is deprecated since version 1.22 and will be removed in Twig 2.0
[file] => /home/xxxx/public_html/wp-content/plugins/sitepress-multilingual-cms/lib/twig/src/Extension/CoreExtension.php
[line] => 388
)

September 11, 2019 at 9:41 am #4552243

George L.

Yet another notice, this time on the latest stable of the woocommerce-multilingual plugin

(
    [type] => 16384
    [message] => Defining the getGlobals() method in the "optimizer" extension without explicitly implementing Twig\Extension\GlobalsInterface is deprecated since version 1.23.
    [file] => /home/xxxx/public_html/wp-content/plugins/woocommerce-multilingual/lib/twig/src/Environment.php
    [line] => 1301
)
September 27, 2019 at 8:35 am #4652295

George Botsev
Supporter

Languages: English (English )

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

Hello!
Sorry for the late reply here.
At the time that you last wrote the issue was not yet completely resolved.
Could you test also the latest released beta 9 of our plugins please?
Also, make sure that you also use the latest beta of WooCommerce Multilingual as the latest stable will not work if you use WPML betas

September 27, 2019 at 8:48 am #4652395

George L.

Hi, have you got a roadmap for releasing these changes as stable?

We had some issues with your latest beta and had to revert to stable, so won't be installing beta on our production servers again.

September 27, 2019 at 10:05 am #4653073

George Botsev
Supporter

Languages: English (English )

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

I am sorry, but I cannot tell when this would be released.
There are pretty big changes and the devs are working hard on improving and addressing all of the reported issues.

September 30, 2019 at 9:09 am #4663207

George L.

As I don't know the exact pages that throw those notices, I cannot reproduce and confirm.

If you removed Twig as mentioned on your previous messages, the errors would go away, as they are all caused by Twig.

I'll wait till you release your next major versions to confirm the issue is resolved.

September 30, 2019 at 9:41 am #4663387

George Botsev
Supporter

Languages: English (English )

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

Yes, our developers are gradually removing Twig and the issue will be fixed.
Once you tested, you can mark this ticket as resolved or ping me so that we can continue the investigation.
I am leaving the status as fixed in next release.