First of all: I really like this modules idea of extending the file field for CCK.
Uploaden files works like a charm. But when I select "File browser", select a file in IMCE and save the node, I get the following error: "Referencing to the file used in the field is not allowed."
Are there permission settings somewhere I need to change in order to get this to work?
Comments
Comment #1
quicksketchSee #438940: Add ability to use file uploaded via FTP
Comment #2
quicksketchComment #3
pdcarto commentedI'm not sure this is a duplicate. #438940: Can't use ftp uploaded files talks about getting files uploaded (via FTP) to a particular directory to work. With IMCE, users can create their own private directories. The issue that this is supposed to be a duplicate of is in fact much narrower, and its proposed solution is unworkable for this more general case. Therefore I propose to re-designate this issue as "active". I'll be happy to be overruled.
Comment #4
maebelater commentedI ran into this very issue, and yes, it is a duplicate of #438940 to a large extent. As quicksketch has pointed out in http://drupal.org/node/438940#comment-1497646 , the issue is not with filefield sources, but rather with instances of IMCE being used elsewhere.
I use Filefield sources to upload images and wysiwyg combo to insert images into textareas(IMCE+FCKeditor+IMCE WYSIWYG Bridge). And this error only appeared with images uploaded through textarea's IMCE instance. I toyed with the idea to hack IMCE, but gave it up.
So the final solution was to disable upload (and thumbnail creation) via IMCE for every IMCE instance, including WYSYWIG editors. I could not find such an option in IMCE config.Thankfully, IMCE now has templates, so I've overidden the imce-content.tpl.php (I was shuffling the layout anyway), adding following php lines right before the "ops-wrapper" div:
No 'upload' link - no problems. IMCE is now reduced to an asset browser, not a file manager. All images are managed through filefield sources, so before you can insert them into textarea, you have to upload them separately (through additional Filefield field that is hidden from final display - I called it "Textarea images"). So far it works a lot like Insert module, but with "image reuse" capability, and being tied directly into wysiwyg editor.
Not an ideal solution, because "upload" link in IMCE is just so... tempting... And I do feel somewhat evil by denying my end user the ability to upload files from such a convinient location. And yes, image management issues are going to turn into nightmare eventually. But it's the best quick fix I can come up with (Media module, where art thou?).
Oh, and do make sure that IMCE directory path and Filefield path point to the same directory. I had to change Filefield path to [user-id] to conform to my IMCE setting.
Comment #5
jgarbe commentedHello all-
I've read through the relevant threads, but I confess I'm still a little confused as to how I should troubleshoot my current situation, which is:
Drupal 6.12
IMCE 6.x-1.3
Filefield 6.x-3.2
ImageField 6.x-3.2
ImageCache 6.x-1.6
FileField Sources 6.x-1.x-dev
[a bewilderingly large array of modules seemingly not related, and so not listed]
I do not have any WYSIWYG installed in any fashion.
I have a content type with only one File CCK field (I've tried this with both the straight up File Upload and ImageField-provided Image flavor)
Same issue as everyone else. I can open the IMCE file browser, upload the file, shows up in preview just dandy, then error message upon save.
If I try to just reference the file after it's been uploaded, it doesn't turn up either. But obviously it's in there, and is also showing up in the DB files table.
In my case, maebelater, I'm not using IMCE in any other instances, unless I'm misunderstanding. Does anyone know what the module conflict is? I have to admit with all the file management recipes floating around, it gets a little confusing for the layman. Thanks for all the hard work!
Comment #6
drein commentedI've the same problem.
I don't use any editor and I speak of files that are uploaded via the normal core of drupal, so, this file exist in the database.
We are not speaking about files that are not referenced.
I installed IMCE only in order to have a method to browse file and I'll try to apply the patch suggested over, and I will let you know what happen.
It seemes that the words "files" and "drupal" are incompatible! :-)
Comment #7
ryivhnn commentedI think I just stonewalled into this problem as well. I was hoping it was just because I'm an idiot :)
I have a similar setup to jgarbe in #5 except with D6.14, and I do have TinyMCE and WysiwygAPI but being used purely for formatting and attempting to clean up after people who insist on pasting from word, IMCE is not attached and is there purely for user file managing purposes (or at the very least so I know who owns what and everything is not blatted in /files which is my current conundrum).
I have no idea if it's getting into the database or not, I'm not sure where to look.
Comment #8
drein commentedOk... I'm sorry but this is a duplicate.
I didn't think so, but I read all other issues and there is people that have the same problem.
In that issue there is an attach.inc file that can help, tomorrow I'll give a try.
Other thing, I tried what maebelater says in #4, modifying the template of IMCE but no success.
This is a pitty because I have files referenced by core upload module, and other no, anyway I think we should move this discussion to the other issue.
bye.
Comment #9
agence web coheractio commentedsubscribing
Comment #10
brianbrarian commentedTo make IMCE into a browse-only tool for Filefield Sources, try going to Admin > Site Config > IMCE and editing the appropriate profiles to uncheck every operation in the directories config except Browse. That appears to be working for me, but I have a limited number of content creators, and I have them all uploading images (via Imagefield) into the same folder. Also, I'm not using IMCE on this site for anything else. (IMCE 6.x-1.3)
Before I stumbled across the IMCE config settings, I tried the tpl.php override in #4, but it didn't work for me ... when I refreshed the directory in IMCE, the unwanted buttons appeared.
Comment #11
vinmassaro commentedHaving the same problem on Filefield Sources 6.x-1.2 and IMCE 6.x-1.3. I upgraded to IMCE 6.x-2.0-rc1 and still see the same problem. When I add an image to filefield sources from the IMCE file browser and save the node, I get the same "Referencing to the file used in the field is not allowed." error and can't save.
Comment #12
vinmassaro commentedComment #13
quicksketchThis isn't a bug, it's the way FileField works. You can't reference files that don't exist in the database.
Comment #14
vinmassaro commentedHow do you remedy it then? All I've done is enabled Filefield Sources and want to use it with IMCE/TinyMCE. I upload a file to TinyMCE, then try to choose it in Filefield Sources, then get this error. =
Comment #15
quicksketchYou can try using IMCE 2.x, which puts entries into the database (like it should have always done). The situation is improved but still not perfect. Note that you'll still never be able to use files uploaded with IMCE 1.x in FileField Sources, since once a file is uploaded without being recorded, it's impossible to tell where that file came from.
Comment #16
pianomansam commentedA temporary solution to this issue has been provided here #454478: The selected file could not be used because the file does not exist in the database.. Obviously we will need a more permanent solution that doesn't rely on hacking FileField. Marking as duplicate to condense our efforts.