Hi, unless I am wrong, this module should correspond to my needs, but it does not work as expected and I don't know where to start to make it work.
I have three entities: A, B and C where B and C refer to A, and C to A (one) and B (several).
In the C content type, I thus used two entity references:
- one static to nodes of types A
- one using a view where field_A is an argument and that returns a list of entity references of type B. The selected mode is "Views: Filter by an entity reference view with dynamic arguments" (thus using the DDF module), and as argument {field_A} which refers to my node of type A.
Please tell me if I do something wrong, or if not, what should I do to give you more debugging information.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 2090493-14-multiple_value_select.patch | 2.44 KB | cadila |
| #9 | multiple_value_select.patch | 1.97 KB | yury n |
Comments
Comment #1
maximpodorov commentedWhat does not work?
Comment #2
bpiwowar commentedOK, I understood what was wrong: DDF works when the dependent field is a SELECT button, but not when it is a list of checkboxes (the user can selected an unlimited number of dependent values).
I will try to make it work, but would appreciate any help on how to add this functionality.
Comment #3
maximpodorov commentedWhat are field type and widget type for this dependent field?
Comment #4
bpiwowar commentedThe widget type is "checkbox / radio button"
The field type is "entity reference"
Comment #5
fruitsalad commentedHi bpiwowar and contributors,
I really would like to use the ddf module as I think it is the right tool to solve my problem.
I got two fields in a content type. One field "companies", that is an organic group. The other field "departments" that is a group itself but also group content of "companies".
I would like to achieve that when a company is selected the "departments" field shows only the departments of the selected company.
Could someone give me a glue how to achieve this with ddf, or if that is not the right tool maybe another way to solve this?
Thank you very much for your time and help!
Comment #6
greenrmor commented@fruitsalad I think this module is not the right one for you... I recommend to use Conditional Fields module instead.. ;)
Comment #7
bruceci commented@fruitsalad this is right module you find,
but with checkbox/radio buttom ,autocomplete wedget do not work, select wedget works good.
Comment #8
thinhnp.it commentedHi everyone,
Could you tell me how to add dependent fields ?
I tried with select widget but It didn't work.
P/S: My situation is same as @fruitsalad.
Thanks.
Comment #9
yury n commentedI've created a patch that adds support for multiple value selects.
Comment #10
bpiwowar commentedThanks Yury, the patch works great. I am trying to adapt it to handling checkboxes instead of a select form (I have ~15 items for each view, and it looks much better like this). I am a bit stuck in
ddf_entityreference.module. Line 61, I replaced$result = form_select_options($element);bybut the problem is that now I don't get in the form the names of the input fields. If you have any advice on how to do this, it would allow me to finish by modifying the javascript code to handle checkboxes.
Comment #11
cadila commentedI've installed this patch and it's fixed multi-value fields. Now values are saving correctly.
Comment #12
cadila commentedComment #13
nhck commentedUnfortnuately this doesn't work if your field is named:
fieldname[und]
Because then the checkboxnames
fieldname[und][1]
but javascript is confused by that.
Comment #14
cadila commentedTry this patch, it may help (first patch is already included in this patch too)
Comment #15
nhck commentedThanks Cadilla, I haven't been able to debug this and find the reason, but as a quick feedback: The patch doesn't do the job, sorry.
Comment #16
cadila commentednhck, try adding your own patch and help yourself and other people with this problem!
Comment #17
nhck commentedSorry, I submitted the last answer too early
This:
>The patch doesn't do the job, sorry.
was to read
>The patch doesn't work with checkboxes, but only with select lists.
Again sorry, and in this sense it works. I made the inclusion of checkboxes/radiobuttons a feature request:
#2192557: Support Checkboxes/Radiobuttons for the dependent field
Comment #18
j3ll3nlMaybe try the project: Reference field option limit
Comment #19
manuelBS commentedWe now created a new module that allows to configure the list of allowed values with a view. This makes it more flexible and integrated with Drupal. You can find it at https://www.drupal.org/project/dfv if this is interesting for you.
Comment #20
maximpodorov commentedI think it's better to develop DDF project with the required functionality.
Comment #21
manuelBS commentedI absolutely agree. It just depends on the use case and the flexibility you need with the module.
Comment #22
maximpodorov commentedThe problem is fixed in the last commit.
http://cgit.drupalcode.org/ddf/commit/?id=a2d06cb
The only problem is checkboxes and radio buttons for dependent fields, since they are multiple widgets, not a single (like selector).
Comment #24
nwom commentedIt appears the patch was not fully committed. I have created a patch for this in the following issue: #3135414: Support Entity Reference Dependents with Multiple Values