• Resolved rom1our

    (@rom1our)


    Hi there,

    in debug.log I see

    PHP Warning:  Undefined array key "link" in */public_html/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 1545
    PHP Warning:  Undefined array key "title" in */public_html/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 436
    PHP Warning:  Undefined array key "alt" in */public_html/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 510
    

    I found this already reported in the forum. How can it be resolved?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @rom1our!

    I apologize for the trouble! The team is aware of these warnings within Envira Gallery Lite, and will be pushing a release shortly that addresses them, specifically. The moment that the release is made public, I’ll be sure to ping you here :).

    Thank you for your patience while we work to get these resolved!

    Thread Starter rom1our

    (@rom1our)

    Hi there, I checked your last release 1.8.6, but there is still an error message, which filles up the debug.log

    PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /public_html/wp-content/plugins/envira-gallery-lite/includes/global/rest.php on line 437

    Hi, @rom1our!

    Thank you for the report! I’ve also sent this notice over to the development team, and this will be fixed with our next release :). The moment I have an ETA to share on this, I’ll be sure to let you know.

    Thank you!

    Hi, @rom1our!

    Just wanted to follow up here and let you know our next release went out, and should resolve the issue!

    Hi,

    I still get the array key warnings in your release 1.8.6.2

    Warning: Undefined array key "link" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 1545
    
    Warning: Undefined array key "title" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 436
    
    Warning: Undefined array key "alt" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 510
    
    Warning: Undefined array key "title" in /xxx/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 510

    My fix for these warnings looks like this, by using a null coalescing operator (??) to the array access, e.g. here shortcode.php on line 510:

    $output_item = '<img id="envira-gallery-image-' . sanitize_html_class( $id ) . '" class="envira-gallery-image envira-gallery-image-' . $i . $gallery_theme . ' ' . $envira_lazy_load . '" data-envira-index="' . $i . '" src="' . esc_url( $output_src ) . '"' . ( $this->get_config( 'dimensions', $data ) ? ' width="' . $this->get_config( 'crop_width', $data ) . '" height="' . $this->get_config( 'crop_height', $data ) . '"' : '' ) . ' data-envira-src="' . esc_url( $output_src ) . '" data-envira-gallery-id="' . $data['id'] . '" data-envira-item-id="' . $id . '" data-envira-caption="' . $title . '" alt="' . esc_attr( $item['alt'] ?? '' ) . '" title="' . wp_strip_all_tags( htmlspecialchars( $item['title'] ?? '' ) ) . '" ' . apply_filters( 'envira_gallery_output_image_attr', '', $id, $item, $data, $i ) . ' itemprop="thumbnailUrl" data-envira-srcset="' . esc_url( $output_src ) . ' 400w,' . esc_url( $output_src ) . ' 2x" data-envira-width="' . $output_width . '" data-envira-height="' . $output_height . '" srcset="' . ( ( $envira_lazy_load ) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' : esc_url( $image_src_retina ) . ' 2x' ) . '" data-safe-src="' . ( ( $envira_lazy_load ) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' : esc_url( $output_src ) ) . '" />';
    

    Hi,

    it seems the issue is not resolved.

    On https://www.bilddesign.at/new-site/kalifornien/
    We have the error message here:

    Warning: Undefined array key “link” in /home/.sites/552/site3088210/web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 1545 Warning: Undefined array key “title” in /home/.sites/552/site3088210/web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 436 Warning: Undefined array key “alt” in /home/.sites/552/site3088210/web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 530 Warning: Undefined array key “link” in /home/.sites/552/site3088210/web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 1545 Warning: Undefined array key “title” in /home/.sites/552/site3088210/web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 436 Warning: Undefined array key “alt” in /home/.sites/552/site3088210/web/new-site/wp-content/plugins/envira-gallery-lite/includes/global/shortcode.php on line 530

    I have tried php 8.0, 8.1 and 8.2, this makes no difference
    Any help is appreciated!

    • This reply was modified 1 year, 1 month ago by dbolius.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘php warning’ is closed to new replies.