When saving a preset a fatal error is thrown on line 789 of imagecache.module:

while (($entry = $d->read()) !== FALSE) {

This is because $d is NULL.

The problem is that the second time through _imagecache_recursive_delete() a directory could have been deleted but the stat cache still contains the directory. Therefore


is_dir($path);

incorrectly returns TRUE, though the directory has just been deleted.

A call to clearstatcache() after the rmdir($path) call fixes the issue.

This issue appears (at least) with this version of PHP: 5.2.4-2ubuntu5.10

Patch attached.

CommentFileSizeAuthor
delete_clear_statcache.patch590 bytesbenkant

Comments

Aniara.io’s picture

Patch works. Thank you!

fizk’s picture

Status: Active » Closed (fixed)
Issue tags: +ImageCache 2.x Todo

Marking as ImageCache 2.x Todo.