Conversation
supportThere is an issue with the // Fix E_WARNING: Illegal string offset 'width' if(!is_array($image_meta_data['sizes']['full'])) { $image_meta_data['sizes']['full'] = array(); code at the website without the ‘full’ image-size. Our WordPress website started to show a Notice – https://i.imgur.com/a7UcRAU.png – in the header of every page of the website: Notice: Undefined index: full in /wp-content/plugins/responsify-wp/includes/create_responsive_image.php 67 This topic was modified 8 years ago by WPO+ . This topic was modified 8 years ago by WPO+ . This topic was modified 8 years ago by WPO+ . This topic was modified 8 years ago by WPO+ .
Same issue in the plugin back-end’s settings: Notice: Undefined index: full in …/wp-content/plugins/responsify-wp/admin/views/selected_sizes.php on line 23 View post on imgur.com
Looking at the following code: $image_meta_data = wp_get_attachment_metadata( $this->id ); … why do you expect to see ‘full’ parent image-size in the array of sub-sizes? // Fix E_WARNING: Illegal string offset 'width' if(!is_array($image_meta_data['sizes']['full'])) { $image_meta_data['sizes']['full'] = array(); } The standard wp_get_attachment_metadata() output looks like this: Array ( [width] => 2400 [height] => 1559 [file] => 2011/12/press_image.jpg [sizes] => Array ( [thumbnail] => Array ( [file] => press_image-150x150.jpg [width] => 150 [height] => 150 [mime-type] => image/jpeg ) [medium] => Array ( [file] => press_image-4-300x194.jpg [width] => 300 [height] => 194 [mime-type] => image/jpeg ) [large] => Array ( [file] => press_image-1024x665.jpg [width] => 1024 [height] => 665 [mime-type] => image/jpeg ) [post-thumbnail] => Array ( [file] => press_image-624x405.jpg [width] => 624 [height] => 405 [mime-type] => image/jpeg ) ) [image_meta] => Array ( [aperture] => 5 [credit] => [camera] => Canon EOS-1Ds Mark III => [created_timestamp] => 1323190643 [copyright] => [focal_length] => 35 [iso] => 800 [shutter_speed] => 0.016666666666667 [title] => ) ) https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/ This reply was modified 8 years ago by WPO+ . This reply was modified 8 years ago by WPO+ .
Info: $fullpath = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ );
Try to dump the array with: $image_meta_data = wp_get_attachment_metadata( $this->id ); echo '<pre>'; var_dump($image_meta_data); echo '</pre>';
Hi Ivan! Thanks for taking the time reporting this. I actually got a pull request with a fix for this, which I released right now (RWP 1.9.10). Does it solve the issue for you?
Hello Stefan, thank you for fixing this in the front-end. Please, notice, as I said earlier, that the issue also exists in the back-end in the plugin setting page – /wp-admin/options-general.php?page=responsify-wp Screenshot: https://i.imgur.com/UIfOzvh.png Notice: Undefined index: full in /wp-content/plugins/responsify-wp/admin/views/selected_sizes.php on line 23 and 24
Hi again, would you please consider trying out RWP 1.9.11 before I release it? I think it should solve both errors. I had to refactor the solutions from the latest pull requests… You can download it here: https://github.com/stefanledin/responsify-wp/tree/1-9-11
Yes, Stefan, the new version fixed the ‘notice’ issues in the front-end and the back-end for our website. Thank you a lot!
Great! Thank you Ivan for helping out!
Same issue in the plugin back-end’s settings: Notice: Undefined index: full in …/wp-content/plugins/responsify-wp/admin/views/selected_sizes.php on line 23 View post on imgur.com
Looking at the following code: $image_meta_data = wp_get_attachment_metadata( $this->id ); … why do you expect to see ‘full’ parent image-size in the array of sub-sizes? // Fix E_WARNING: Illegal string offset 'width' if(!is_array($image_meta_data['sizes']['full'])) { $image_meta_data['sizes']['full'] = array(); } The standard wp_get_attachment_metadata() output looks like this: Array ( [width] => 2400 [height] => 1559 [file] => 2011/12/press_image.jpg [sizes] => Array ( [thumbnail] => Array ( [file] => press_image-150x150.jpg [width] => 150 [height] => 150 [mime-type] => image/jpeg ) [medium] => Array ( [file] => press_image-4-300x194.jpg [width] => 300 [height] => 194 [mime-type] => image/jpeg ) [large] => Array ( [file] => press_image-1024x665.jpg [width] => 1024 [height] => 665 [mime-type] => image/jpeg ) [post-thumbnail] => Array ( [file] => press_image-624x405.jpg [width] => 624 [height] => 405 [mime-type] => image/jpeg ) ) [image_meta] => Array ( [aperture] => 5 [credit] => [camera] => Canon EOS-1Ds Mark III => [created_timestamp] => 1323190643 [copyright] => [focal_length] => 35 [iso] => 800 [shutter_speed] => 0.016666666666667 [title] => ) ) https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/ This reply was modified 8 years ago by WPO+ . This reply was modified 8 years ago by WPO+ .
Info: $fullpath = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ );
Try to dump the array with: $image_meta_data = wp_get_attachment_metadata( $this->id ); echo '<pre>'; var_dump($image_meta_data); echo '</pre>';
Hi Ivan! Thanks for taking the time reporting this. I actually got a pull request with a fix for this, which I released right now (RWP 1.9.10). Does it solve the issue for you?
Hello Stefan, thank you for fixing this in the front-end. Please, notice, as I said earlier, that the issue also exists in the back-end in the plugin setting page – /wp-admin/options-general.php?page=responsify-wp Screenshot: https://i.imgur.com/UIfOzvh.png Notice: Undefined index: full in /wp-content/plugins/responsify-wp/admin/views/selected_sizes.php on line 23 and 24
Hi again, would you please consider trying out RWP 1.9.11 before I release it? I think it should solve both errors. I had to refactor the solutions from the latest pull requests… You can download it here: https://github.com/stefanledin/responsify-wp/tree/1-9-11
Yes, Stefan, the new version fixed the ‘notice’ issues in the front-end and the back-end for our website. Thank you a lot!
Great! Thank you Ivan for helping out!