looks like it does, but it actually doesn't receive it in the first place. i need it for audio filefield... here's a patch

CommentFileSizeAuthor
filefield_file_load.patch1.27 KBaaron
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jpetso’s picture

Status: Needs review » Needs work

Hm... hook_file() does not pass any additional info at all for the 'file_load' action. I wonder if it's a good idea to add this when we know it'll be gone soon anyways.

And more questions, just because I'm interested:
- why do you pass $item one time and $node the other time?
- why is there an additional unused $file parameter in the _filefield_file_load() function signature? doesn't that even conflict with $fid being passed?
- if you need $item, wouldn't it make more sense to merge the CCK-provided part of $item first, before invoking the hook?
- how (and which parameters) are you going to use this when it gets in?

I'm setting this back to "code needs work", if not for the other issues then at least because the $file parameter seems odd to me.

dopry’s picture

Version: 5.x-2.3-rc3 » 5.x-2.3-rc4

@aaron, hook_filefield is a prototype of hook_file... Why do you need the field information when saving the file data? how are you using it? I need clarification on the use case... we may need to overload hook_file for field based purposes, or attach the field info to the items if there isn't a work around.

dopry’s picture

Status: Needs work » Closed (fixed)

no response and this issue is by design to match hook_file as proposed for core.