If I bulk upload a file in IMCE, and then select it, I get the error:

Referencing to the file used in the Image field is not allowed.

...when i try to save the node. Now this seems to be very similar to this issue, but arising only with IMCE SWFUpload bulk uploads, not with normal IMCE uploads (as is the case with that issue).

I can patch modules/filefield/filefield_widget.inc to fix it, as described on the same issue, but it's a security hole if your site has untrusted logged in users (they can delete any uploaded files that are no longer referenced, apparently).

That issue seems to have been fixed in the latest versions of FileField and ImageField (version 3.9), and I was wondering if there was a fix for bulk uploads too, without the need for the FileField patch?

A CLUE: the problem appears to be because modules/imce/imce.module::imce_file_references($file) wasn't returning the correct number of IMCE references to a specific file, though I'm unsure what IMCE SWFUpload is doing wrong that causes this function to fail.

NOTE: My little stack of modules to get all this working... IMCE SWFUpload 2.1, IMCE 6.x-2.3+6-dev, FileField Sources 1.4, ImageField 6.x 3.9 and FileField 6.x 3.9

Comments

chichilatte’s picture

Got the solution: IMCE for Filefield. Works a treat, and a much nicer interface. If you're using multiple-value filefields you'll need to patch it. And if you want to use it with video fields, that's another patch.