Download & Extend

Array warnings when not adding/updating filefields/imagefields.

Project:File (Field) Paths
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Moonshine
Status:closed (fixed)

Issue Summary

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:

<?php
if (is_array($ffp['#types'])) {
...
}
?>
AttachmentSize
filefield-paths-non-array.patch1.72 KB

Comments

#1

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.

#2

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 :)

#3

Status:fixed» closed (fixed)
nobody click here