Basically when you submit a node without any filefield or imagefield additions or changes, there won't be entries added into $ffp as the "!empty($file['data']['process']" condition never hits.

So you get warnings like:

    * warning: Invalid argument supplied for foreach() in /var/www/html/drupal/drupal-6.6/sites/all/modules/filefield_paths/filefield_paths.module on line 284.
    * warning: Invalid argument supplied for foreach() in /var/www/html/drupal/drupal-6.6/sites/all/modules/filefield_paths/filefield_paths.module on line 296.

Included patch just wraps that section with:

if (is_array($ffp['#types'])) {
...
}
CommentFileSizeAuthor
filefield-paths-non-array.patch1.72 KBMoonshine
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deciphered’s picture

Cheers moonshine, can chalk that one up to lack of testing; tested some weird use cases, but that's one that obviously didn't occur to me.

Will review the issue/patch shortly.

Deciphered’s picture

Status: Needs review » Fixed

Issue and fix confirmed, I modified it slightly and it has been committed to HEAD and DRUPAL-5.

Thanks for the testing :)

Deciphered’s picture

Status: Fixed » Closed (fixed)