Undefined array key in tnp_composer_block_posts_get_media
-
Function
tnp_composer_block_posts_get_media()is called with a$sizeparameter from e.g.emails/blocks/posts/layout-two.phpwhich there contains this:$size = array(600, 400, $image_crop);If no
$post_thumbnail_idis available the function tries$default_image_urland 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 462Newsletter 8.8.2
Viewing 6 replies - 1 through 6 (of 6 total)
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.