WPML
Status
Resolved
Resolved in
4.5.6
Related plugin/theme
Divi

Overview of the issue

In some cases, after updating WPML and Divi theme to their recent versions, you may get the following notice:

Warning: Undefined array key “display_conditions” in …/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/DisplayConditions.php on line 23

Workaround

This warning is not harmful but our developers are working on it. In the meantime you can apply any of the two following workarounds after making a full back up of your site.

  1. Open your functions.php file.
  2. Add this code:
     $should_i_run = get_transient( 'divifix' ); if ( $should_i_run == false ) { set_transient( 'divifix', true, 10000); $test = get_option( "et_divi" ); unset ( $test["builder_global_presets_history"] ); update_option( "et_divi", $test ); } 
  3. Visit your site’s front-end.
  4. Remove the previous code.

If this does not work, you can:

  1. Open the file /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/DisplayConditions.php.
  2. Look for line 23.
  3. Replace:
     if ( $atts['display_conditions'] && self::BASE64_EMPTY_ARRAY !== $atts['display_conditions'] ) { 
    With:
     if ( isset( $atts['display_conditions'] ) && self::BASE64_EMPTY_ARRAY !== $atts['display_conditions'] ) { 

All known issues →