Since I just upgraded to Drupal 5.2 and image 5.x-1.6 (after some problems which I seem to have resolved without knowing how...), every now and then I get the message that derivative images for this or that image have been regenerated. This is normal I think since I have defined some new sizes.
However, each time this happens it seems to be accompanied by this message:
warning: Invalid argument supplied for foreach() in /home/gmpmprdg/public_html/500/includes/file.inc on line 551.
This doesn't seem to stop things working, so I carry on, however...
Comments
Comment #1
Robert de Bock commentedI have the same problem, let me describe a bit more:
I upgraded from Drupal 5.5 to Drupal 5.6 -and- upgraded the image module from a non-dev version (5.x.1.6) to a dev version (5.x.2.x-dev).
Since these upgrades (could be one or both upgrades combined that caused this error) I can't see images anymore.
Running upgrade.php caused an error that I did not save.
And the errors logged now when viewing images is:
Invalid argument supplied for foreach() in /var/www/virtualhosts/meinit/html/includes/file.inc on line 553.The log is also filled with regeneration messages like:
Derivative images were regenerated for Image: mypicture.I will downgrade to 5.x.1.6 now, but am pretty sure I could reproduce this problem. This is the second time this week trying to upgrade the image module.
Comment #2
anarcat commentedWe stumbled upon this issue here after an upgrade from drupal 4.7. There's a simple fix:
Comment #3
drewish commentedjust looking at the patch i'm not sure what this would be solving... you wouldn't be transfering the image so wouldn't that be a bug as well?
Comment #4
anarcat commentedI don't think so. If image_file_download() returns false, then there's no image and the code will drop through the "file not found" error, which is fine.
Anyways, image_file_download() should be error-checked before blindly taking what it returns and pass it to another function. In our case, image_file_download() returns -1 so it tells us the image disappeared somehow and we shouldn't try to send it.
Comment #5
jvlagsma commentedJust upgraded to image 5.x-1.9 and the problem still exists. Applied the above solution and it is fine now. Any chance this can be permanently solved in next versions?
Comment #6
drewish commentedanarcat, well -1 evaluates to true so i'm not seeing how that would be improved error-checking.
Comment #7
drewish commentedComment #8
sunPlease submit a proper patch. See http://drupal.org/patch for details.
Comment #9
sunAttached patch implements the same logic as file.inc.
Comment #10
sunCommitted to 6.x and 5.x-2.x.