Skip Navigation

Resolved

Resolved in: 4.5.6

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'] ) { 

2 Responses to “Divi - Warning: Undefined array key "display_conditions"...”

  1. This is creating a new error:

    Warning foreach() argument must be of type array|object, null given 74
    wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/DisplayConditions.php:27
    WPML\C\D\DisplayConditions->translateAttributes()
    wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php:15
    WPML\FP\{closure}()
    wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php:207
    WPML\FP\Right->map()
    wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php:257
    WPML\FP\Right->chain()
    wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php:24
    WPML\FP\Promise->resolve()
    wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php:50
    WPML\L\W\Hooks::WPML\L\W\{closure}()
    wp-includes/class-wp-hook.php:309
    apply_filters(‘et_pb_module_shortcode_attributes’)
    wp-content/themes/Divi/includes/builder/class-et-builder-element.php:2794
    ET_Builder_Element->_render()
    wp-includes/shortcodes.php:356
    do_shortcode_tag()
    Posizione sconosciuta
    preg_replace_callback()
    wp-includes/shortcodes.php:228
    do_shortcode()
    wp-includes/class-wp-hook.php:307
    apply_filters(‘the_content’)
    wp-includes/post-template.php:253
    the_content()
    wp-content/themes/Divi/page.php:46

    • Hello, thank you for reporting this. Please open a ticket on our support forum and one of our technical expert will help you.