• Resolved Ov3rfly

    (@ov3rfly)


    Function tnp_composer_block_posts_get_media() is called with a $size parameter from e.g. emails/blocks/posts/layout-two.php which there contains this:

    $size = array(600, 400, $image_crop);

    If no $post_thumbnail_id is available the function tries $default_image_url and gets width/height via array keys from $size:

    } elseif ($default_image_url) {
        Newsletter::instance()->logger->error('Thumbnail id not found');
        $media = new TNP_Media();
        $media->url = $default_image_url;
        $media->width = $size['width'];
        $media->height = $size['height'];

    These array keys do not exist in above described case and cause these warnings:

    [10-May-2025 09:40:51 UTC] PHP Warning: Undefined array key "width" in …/wp-content/plugins/newsletter/includes/helper.php on line 461
    [10-May-2025 09:40:51 UTC] PHP Warning: Undefined array key "height" in ../wp-content/plugins/newsletter/includes/helper.php on line 462

    Newsletter 8.8.2

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Michael Travan

    (@michael-travan)

    Hello @ov3rfly,

    thanks for reporting, I’ve passed this to our developers for further evaluation.

    Regards,
    Michael

    Thread Starter Ov3rfly

    (@ov3rfly)

    Issue is still present in Newsletter 8.8.7

    Plugin Support Michael Travan

    (@michael-travan)

    Hello,

    we just released Newsletter 8.8.8 which fixes various php warnings. Check it out!

    Michael

    Thread Starter Ov3rfly

    (@ov3rfly)

    Issue still there with Newsletter 8.9.0:

    [09-Jun-2025 10:23:42 UTC] PHP Warning:  Undefined array key "width" in ../wp-content/plugins/newsletter/includes/helper.php on line 461
    [09-Jun-2025 10:23:42 UTC] PHP Warning: Undefined array key "height" in ../wp-content/plugins/newsletter/includes/helper.php on line 462

    Example testcase: Fresh WordPress install (with default Hello world! post without featured image) -> fresh install Newsletter Plugin -> Newsletters -> Add new -> use Zen -> add Blog Posts block -> Save Button -> edit Blog Posts block -> change Layout to Two Columns -> Save Button

    Plugin Support Michael Travan

    (@michael-travan)

    Hello,

    our developers are currently at it. Thanks for your valuable feedback, @ov3rfly : )

    Michael

    Thread Starter Ov3rfly

    (@ov3rfly)

    Issue is still present in Newsletter 8.9.2

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Undefined array key in tnp_composer_block_posts_get_media’ is closed to new replies.