Closed (duplicate)
Project:
FileField Sources
Version:
6.x-1.4
Component:
Source: Auto-complete
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2011 at 16:31 UTC
Updated:
17 Sep 2015 at 23:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
solotandem commentedI have the same problem. Before looking at the code, my expectation was that all files uploaded to any content field would be available for reuse with any other content field. After looking at the code, I see that you restrict the search to files previously associated with the content field being edited.
I also see that the documentation comment and function signature seem to anticipate searching among all content fields by default.
Yet the invocation of this function is always with a non-NULL field, thereby restricting the search to files associated with that content field. Is the "all fields search" an un-implemented feature? Would you unlock it by adding a widget setting? (If there is one and I have missed it, please let me know.)
Comment #2
solotandem commentedThe attached patch adds a widget setting and implements it.
Comment #3
asiby commentedThis patch is incompatible with the module.
Comment #4
solotandem commentedWhat does "incompatible" mean? Based on what criteria? Please elaborate.
Comment #5
asiby commentedThank you for your quick response. The patch cannot be applied. I had to add the changes manually. And it did not work. I am using the version 7.x-1.4 and I keep getting the error message "The file used in the Image field may not be referenced." when trying to reference an existing image.
I am familiar with the process of patching a file and this is not the first time for me to do it.
For example, if you look at this section of the file ....
The part that says '#default_value' => empty($field['filefield_source_autocomplete']) ? '0' : '1', does not exist in the current D7 version of the module.
I will appreciate any pointers for things that I need to adjust in order to make this work. It is very crucial because I have used the Media module and suddenly realized that the filefield_source will not read files uploaded using other fields. However, the Media module combined with the plupload module that I am using are not using any particular fields. Besides, the filefield is not yet supporting plupload.
Here is what I get when trying to patch the file
Thanks again.
Comment #6
asiby commentedSorry. I just realized that this patch was meant for the version 6.x-1.4
My mistake.
Any pointers about what I should change? I think it has to do with the file_usage table not being added populated during the referencing. Unfortunately, I am not yet familiar with that aspect of Drupal 7.
Cheers
Comment #7
asiby commentedI think I found it.
In file.module, there is this ...
So I think that I might simply use a hook to replace this validation function that allows what I need to do.
Comment #8
imclean commented#730578: Options for Autocomplete (restrict file list)
http://drupal.org/project/filefield_sources_reference_opt
Comment #9
giorgoskfor drupal 7 but perhaps this is also related #454982: Reference all filefield files