I am using the noderelationships module to create nodereference nodes in a modal window over the top of its parent node. These nodes that appear in the modal window work fine except for the filefield_sources functionality. Clicking on File browser, Reference existing or Remote URL simply hides the upload field. There is no Javascript error. The normal upload functionality works fine, and if I click Remote URL and use firebug to make the input appear it doesn't work either.
Not sure if this issue is for filefield_sources, modalframe or noderelationships. You might also call it a feature request.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | filefield_sources_classname.patch | 1.6 KB | quicksketch |
| #3 | filefield_sources-827652.patch | 1.92 KB | hefox |
| #1 | 827652_filefield_sources_selector.patch | 1.55 KB | hefox |
Comments
Comment #1
hefox commentedModal frame adds a processed class to all links
Filefield sources selects a div based on ALL classes the link has.
*boom*
Comment #2
quicksketchThanks hefox. This looks pretty good but I have the feeling we could get it down to a single line of code by using a regex of some sort. The name of our variable should be camelCase within JavaScript (i.e. filefieldSelector).
Another approach would be just to add the FileField Sources JavaScript file after other modules have added their JavaScript and added the extra classes. We're definitely working with somewhat inconsistent HTML classes here, since some modules would likely add a class that doesn't even contain "filefield" (say if IMCE started providing its own source, the class name should start with "imce", not "filefield").
Comment #3
hefox commentedAs mentioned on irc, it looks like having the div with the class filefield-sources- was already a pre-req for this working and that was unique identifiable to the div for set of links, so continuing on that thought here's patch that uses a regular expression to isolate the classname.
Removes the removing/adding back in of active class also as I don't believe that is needed anymore.
Comment #4
quicksketchThis patch combines what I said in #2 and hefox's patch in #3, where the name of the class is properly formatted (in camelCase) as well as put into a local scope. I changed our use of hide() and show() methods to use css() instead, so that the showing and hiding will work when the FileField is within a collapsed fieldset or in vertical tabs.
This is still necessary and our CSS specifically targets links with the "active" class to make them bold, showing which source link is selected.
Please reopen if further changes look like they'll be needed here. I've committed this patch to CVS.
Comment #6
TheDanScott commentedI am still experiencing this issue with 6.x-1.2. I am using vertical tabs and I can confirm that filefield sources doesn't work when image fields are placed in field groups that are rendered either as fieldsets, or vertical tabs.
Filefield sources *does* work when the same image fields are moved out of a field group and placed on the edit form as top-level fields.
Comment #7
TheDanScott commentedMy apologies all. It seems I got lost in a sea of content types with slightly different settings for the same fields. I had missed the "file sources" fieldset in the field configuration. Filefield sources are working fine in fieldsets *and* vertical tabs.