Support » Plugin: Featured Image Admin Thumb » How to cure sql corruption

  • Resolved cristofayre

    (@cristofayre)


    I have media files installed in folders 05/06 and 07. But after creating a new SQL database in July, WordPress will not recognise month 05 or 06 folders. (Understand this is a WordPress bug that’s been going on for 3 years or more!) As such, all the thumbs have ‘vanished’, and left me with this on the admin page:

    Warning: Invalid argument supplied for foreach() in D:\home\cristofa\public_html\eco-rainbo\wiki\wp-content\plugins\featured-image-admin-thumb-fiat\admin\class-featured-image-admin-thumb-admin.php on line 313

    Even adding a new thumb doesn’t get rid of the above, (despite image showing OK on post) Feel it’s because it cannot ‘see’ the media files.

    had a look ar SQL postmeta re thumbnail_id / meta value, but no idea what all that means!

    Uploaded all images again to 07 folder, but have no idea how to “regenerate” all the thumbnail ID’s to point to images, (and get rid of the Warning prompt) In an ideal World, if I could get the 05/06 folders to be “seen” again, it might cure problem.

    https://wordpress.org/plugins/featured-image-admin-thumb-fiat/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sean Hayes

    (@seanchayes)

    Thank you for reporting and I’ll review how best to address this. Looks like I need to improve my error checking.

    In the meantime for your thumbnail regeneration perhaps try:

    https://wordpress.org/plugins/regenerate-thumbnails/

    Thank you for using my plugin.

    Just done a little more “digging”, and from what I can follow, the script interogates the “_wp_attachment_metadata” to get the width, height, file, sizes and meta_data. Wonder if it is the sizes array that’s missing, and throwing the whole thing. I’ve listed one of my entries, and as you see it jumps from file to image_meta: no sizes are serailised. But in the program, line 306, it has
    $tpm = wp_get_attachment_metadata( $thumbnail_id );
    $sizes = $tpm[‘sizes’];”
    ie seeking the sizes array, which is then used in the for loop that’s generating the error at line 313

    a:4:{s:5:”width”;i:298;s:6:”height”;i:298;s:4:”file”;s:22:”2015/07/washnnwax4.jpg”;s:10:”image_meta”;a:11:{s:8:”aperture”;i:0;s:6:”credit”;s:0:””;s:6:”camera”;s:0:””;s:7:”caption”;s:0:””;s:17:”created_timestamp”;i:0;s:9:”copyright”;s:0:””;s:12:”focal_length”;i:0;s:3:”iso”;i:0;s:13:”shutter_speed”;i:0;s:5:”title”;s:0:””;s:11:”orientation”;i:0;}}

    This might give you a few pointers if it’s something that the latest WordPress version has ‘broken’

    ** I should add that this is on a Windows offline installation if that’s throwing a spanner in the works

    I was “half right” with the above!

    Program works fine when run on the intended Unix platform, (ie web server) but for anyone developing a site using an offline setup, expect the above errors. It seems that when used on the Windows enviroment, one program or another is incapable of generating the various thumbnails, and the “sizes” array that fits within the “wp_attachment” SQL entry.

    It still shows the image, but PHP throws up the warning message

    Plugin Author Sean Hayes

    (@seanchayes)

    Thanks very much for reporting and providing feedback.

    I have made an update to the plugin to help prevent this error and to coincide with the upcoming release of WordPress 4.3.

    Thank you for using my plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to cure sql corruption’ is closed to new replies.