Dies ist das technische Support-Forum für WPML - das mehrsprachige WordPress-Plugin.

Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team beantwortet Anfragen im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.

Heute stehen keine Supporter zur Arbeit im German-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Schlagwörter: 

This topic contains 1 Antwort, has 2 Teilnehmer.

Last updated by Cristina vor 1 Jahr, 5 Monate.

Assigned support staff: Cristina.

Autor Beiträge
Mai 10, 2018 um 9:49 am #2068808

alexanderB-11

Hi

I get a PHP error warning from wpml:

PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /.../greenlane.ch/wp-content/plugins/sitepress-multilingual-cms/lib/dqml2tree.php on line 475

Could you please help me solving this problem?

Thank you

Mai 10, 2018 um 10:16 am #2069324

Cristina

Hello Alexander,

thanks for contacting us on this.

The each() function has been deprecated in PHP 7.2 however, the output will be same it just a warning. As this version came out when the development cycle for the latest release was already finished the issue was not included in version 3.9.4.

However, this issue shouldn't block anything it is just a warning of deprecated function.

Our developers are aware of this situation and it will most probably be resolved in the next major version(WPML 4.0) of WPML.

Since we are still running our test procedures I cannot pinpoint the exact date that this version will be released, but a beta version should be available in short.

In the meantime, you have a couple of options to avoid this error being shown on your site:

- Disable the WordPress debug:

Inside the wp-config.php file, replace the line:

define( 'WP_DEBUG', true );

with:

define( 'WP_DEBUG', false );[php]

-  Error Control Operators

You can suppress the error individually by changing one of WPML's file. It is located in file sitepress-multilingual-cms/lib/dqml2tree.php @ Line 475. You will replace the following:

[php]
while ( list( $branch, $sub_tree ) = each( $_tree ) ) {

with:

while ( list( $branch, $sub_tree ) = @each( $_tree ) ) {

For reference: hidden link

- You can downgrade PHP to a version lower than 7.2. This option will probably not be feasible since it contains a lot of variables ranging from who is hosted on the machine with your site to the capacity of your hosting service to downgrade PHP.

Kind regards,
Cristina