Closed (fixed)
Project:
File (Field) Paths
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Dec 2009 at 15:46 UTC
Updated:
25 Dec 2009 at 06:30 UTC
filefield.inc on line 87
$objects[] = $node->nid
if using multi-upload for filefield,the $bojects will be
array(1,1,1,1,2,3)
means that $node->nid = 1 has a 4 files attached in 1 filefield ,and this will be batch processed 4 times,actually the first process has done everyting ok for nid 1,so the last 3 processes will call a file_move error.
the fix,is simple: if(!in_array($node->nid,$objects)) $objects[] = $node->nid;
hope this could be fixed soon;
Comments
Comment #1
decipheredHi techlive,
Can you please clarify multi-upload for filefield? Are you referring to having multiple filefield's via CCK settings, or is 'multi-upload' a seperate module?
Let me know.
Cheers,
Deciphered.
Comment #2
weynhamzsorry,via cck settings.
Comment #3
decipheredHmm, curious.
I have unlimited files set on most of my production sites using FileField Paths and I've never had any issues.
Can you provide some more information, such as the versions of the modules you are using and a simple step-by-step guide to reproduce the issues? Settings and error messages would be appreciated too.
Hope I can help.
Cheers,
Deciphered.
Comment #4
weynhamzMay be it's my mistake,i am developing a new module work with the filefield,need to update the filepath using the filefieldpaths module,so i use the function
filefield_paths_batch_update($fieldname,'filefield', $node_type);to do this.Let me do more tests and find what's wrong.My module is developing,there have been many bugs,maybe caused be them.I will contact you later.Comment #5
weynhamzOtherwise,Is there any api can be used to get a filefieldpaths defined token replaced file path?
Comment #6
decipheredOk, looked at the information you provided properly and you are intact correct, there is definitely an issue, not critical, but still an issue and it will be fixed in the next version which should be out shortly.
Thanks for pointing it out :)
Cheers,
Deciphered.
Comment #7
decipheredSimple fix for you until I commit the code.
In the
filefield_paths_batch_updatefunction, wrap the$objects(inside$batch) witharray_unique().Another thing, the code I will be committing actually changes that function a little, which means you'll have to change your code accordingly. It's only a minor thing, the variables have slightly changed, but the way it was written previously was a little crazy.
Cheers,
Deciphered.
Comment #8
decipheredFix committed to DRUPAL-6--1.
Cheers,
Deciphered.