WARNING: STRRPOS() EXPECTS PARAMETER 1 TO BE STRING, ARRAY GIVEN
-
Hi David,
Today noticed many recurring PHP warnings in
php_error.login the staging site (WAMP32/PHP7.1/Win7-64):WARNING: STRRPOS() EXPECTS PARAMETER 1 TO BE STRING, ARRAY GIVEN IN D:\DOMAINS\MYDOMAIN.COM\WP-CONTENT\PLUGINS\MEDIA-LIBRARY-ASSISTANT\INCLUDES\CLASS-MLA-SHORTCODE-SUPPORT.PHP ON LINE 1046NOTICE: ARRAY TO STRING CONVERSION IN D:\DOMAINS\MYDOMAIN.COM\WP-CONTENT\PLUGINS\MEDIA-LIBRARY-ASSISTANT\INCLUDES\CLASS-MLA-SHORTCODE-SUPPORT.PHP ON LINE 1286Warning: urlencode() expects parameter 1 to be string, array given in D:\domains\MYDOMAIN.COM\wp-content\plugins\media-library-assistant\includes\class-mla-list-table.php on line 1418The culprit seems to lead to invalid Attachment Metadata. The MLA Assistant hints to metadata that has somehow duplicated. For example:
array ( 0 => array ( 'width' => 1500, 'height' => 1558, 'file' => 'card-back1-w__custom.jpg', 'sizes' => array ( 'quick_view_image_size' => array ( 'file' => 'card-back1-w__custom-481x500.jpg', 'width' => 481, 'height' => 500, 'mime-type' => 'image/jpeg', ), 'thumbnail' => array ( 'file' => 'card-back1-w__custom-150x150.jpg', 'width' => 150, 'height' => 150, 'mime-type' => 'image/jpeg', ), 'medium' => array ( 'file' => 'card-back1-w__custom-289x300.jpg', 'width' => 289, 'height' => 300, 'mime-type' => 'image/jpeg', ), 'medium_large' => array ( 'file' => 'card-back1-w__custom-768x798.jpg', 'width' => 768, 'height' => 798, 'mime-type' => 'image/jpeg', ), 'large' => array ( 'file' => 'card-back1-w__custom-986x1024.jpg', 'width' => 986, 'height' => 1024, 'mime-type' => 'image/jpeg', ), 'widget-thumbnail' => array ( 'file' => 'card-back1-w__custom-75x75.jpg', 'width' => 75, 'height' => 75, 'mime-type' => 'image/jpeg', ), 'woocommerce_thumbnail' => array ( 'file' => 'card-back1-w__custom-247x296.jpg', 'width' => 247, 'height' => 296, 'mime-type' => 'image/jpeg', 'uncropped' => true, ), 'woocommerce_single' => array ( 'file' => 'card-back1-w__custom-510x530.jpg', 'width' => 510, 'height' => 530, 'mime-type' => 'image/jpeg', ), 'woocommerce_gallery_thumbnail' => array ( 'file' => 'card-back1-w__custom-100x100.jpg', 'width' => 100, 'height' => 100, 'mime-type' => 'image/jpeg', ), 'shop_catalog' => array ( 'file' => 'card-back1-w__custom-247x296.jpg', 'width' => 247, 'height' => 296, 'mime-type' => 'image/jpeg', 'uncropped' => true, ), 'shop_single' => array ( 'file' => 'card-back1-w__custom-510x530.jpg', 'width' => 510, 'height' => 530, 'mime-type' => 'image/jpeg', ), 'shop_thumbnail' => array ( 'file' => 'card-back1-w__custom-100x100.jpg', 'width' => 100, 'height' => 100, 'mime-type' => 'image/jpeg', ), ), 'image_meta' => array ( 'aperture' => '0', 'credit' => 'Eva Campbell - EvitaWorks', 'camera' => '', 'caption' => 'Card Back1 W Custom', 'created_timestamp' => '0', 'copyright' => '(c) EvitaWorks.com. All rights reserved. Forbidden commercial use without permission.', 'focal_length' => '0', 'iso' => '0', 'shutter_speed' => '0', 'title' => 'Card Back1 W Custom', 'orientation' => '0', 'keywords' => array ( ), ), ), 1 => array ( 'width' => 1500, 'height' => 1558, 'file' => 'card-back1-w__custom.jpg', 'sizes' => array ( 'quick_view_image_size' => array ( 'file' => 'card-back1-w__custom-481x500.jpg', 'width' => 481, 'height' => 500, 'mime-type' => 'image/jpeg', ), 'thumbnail' => array ( 'file' => 'card-back1-w__custom-150x150.jpg', 'width' => 150, 'height' => 150, 'mime-type' => 'image/jpeg', ), 'medium' => array ( 'file' => 'card-back1-w__custom-289x300.jpg', 'width' => 289, 'height' => 300, 'mime-type' => 'image/jpeg', ), 'medium_large' => array ( 'file' => 'card-back1-w__custom-768x798.jpg', 'width' => 768, 'height' => 798, 'mime-type' => 'image/jpeg', ), 'large' => array ( 'file' => 'card-back1-w__custom-986x1024.jpg', 'width' => 986, 'height' => 1024, 'mime-type' => 'image/jpeg', ), 'widget-thumbnail' => array ( 'file' => 'card-back1-w__custom-75x75.jpg', 'width' => 75, 'height' => 75, 'mime-type' => 'image/jpeg', ), 'woocommerce_thumbnail' => array ( 'file' => 'card-back1-w__custom-247x296.jpg', 'width' => 247, 'height' => 296, 'mime-type' => 'image/jpeg', 'uncropped' => true, ), 'woocommerce_single' => array ( 'file' => 'card-back1-w__custom-510x530.jpg', 'width' => 510, 'height' => 530, 'mime-type' => 'image/jpeg', ), 'woocommerce_gallery_thumbnail' => array ( 'file' => 'card-back1-w__custom-100x100.jpg', 'width' => 100, 'height' => 100, 'mime-type' => 'image/jpeg', ), 'shop_catalog' => array ( 'file' => 'card-back1-w__custom-247x296.jpg', 'width' => 247, 'height' => 296, 'mime-type' => 'image/jpeg', 'uncropped' => true, ), 'shop_single' => array ( 'file' => 'card-back1-w__custom-510x530.jpg', 'width' => 510, 'height' => 530, 'mime-type' => 'image/jpeg', ), 'shop_thumbnail' => array ( 'file' => 'card-back1-w__custom-100x100.jpg', 'width' => 100, 'height' => 100, 'mime-type' => 'image/jpeg', ), ), 'image_meta' => array ( 'aperture' => '0', 'credit' => 'Eva Campbell - EvitaWorks', 'camera' => '', 'caption' => 'Card Back1 W Custom', 'created_timestamp' => '0', 'copyright' => '(c) EvitaWorks.com. All rights reserved. Forbidden commercial use without permission.', 'focal_length' => '0', 'iso' => '0', 'shutter_speed' => '0', 'title' => 'Card Back1 W Custom', 'orientation' => '0', 'keywords' => array ( ), ), ), )Have no idea why or when this had happened. I’m currently attempting to fix this with the Fix Media Library plugin.
My questions are:
1) Has MLA specific functionality that may help fixing issues like this?
2) Would you consider addressing this issue in code? A workaround that’s working for me is hacking the$base_filevariable intoclass-mla-shortcode-support.phpat line 1012, andclass-mla-list-table.phpat line 1414:
$base_file = is_array($base_file) ? $base_file[0]: $base_file;Update:
Fix Media Librarysays it has found many issues, but didn’t fix the duplicating problem, unfortunately.Thank you!
The topic ‘WARNING: STRRPOS() EXPECTS PARAMETER 1 TO BE STRING, ARRAY GIVEN’ is closed to new replies.