Small error, filefield meta doesn't check to see if a file is attached before trying to get info from it. I think filepath will always exist, if there is a better metric to test with...

Index: filefield_meta.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield/filefield_meta/filefield_meta.module,v
retrieving revision 1.8
diff -u -r1.8 filefield_meta.module
--- filefield_meta.module       4 Feb 2009 10:19:38 -0000       1.8
+++ filefield_meta.module       19 Mar 2009 04:18:38 -0000
@@ -31,9 +31,11 @@
  * Implementation of filefield's hook_file_insert().
  */
 function filefield_meta_file_insert(&$file) {
-  filefield_meta($file);
-  $record = array_merge(array('fid' => $file->fid), $file->data);
-  drupal_write_record('filefield_meta', $record);
+  if (isset($file->filepath)) {
+    filefield_meta($file);
+    $record = array_merge(array('fid' => $file->fid), $file->data);
+    drupal_write_record('filefield_meta', $record);
+  }
 }
 
 /**

Thanks,
jrp

CommentFileSizeAuthor
#1 filefield_meta_hook_check.patch1.11 KBquicksketch

Comments

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new1.11 KB

Thanks I committed a slight changed patch that checks the $file->fid instead and does the same check on update.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.