Hello,
I installed the module and created a conditional dependency. In condition I selected "value", in values input mode I selected "Insert value from widget" and then I selected the value of the taxonomy that I want to execute the condition. In Interaction with other dependencies I selected "AND", in Form state I selected "Visible" and in effects "Show/Hide".
After performing this configuration, when I select the category that supposedly should show/hide the target field, it does nothing. The target field is always visible.
Any Suggestions?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | conditional_fields_fix_checkboxes_2912357_6.patch | 1.31 KB | nkoporec |
Comments
Comment #2
lee.cocklin commentedI made a patch for a project that fixes this issue (see below). You may have to change the module path for it to work in your project.
Comment #3
nkoporecHi @lee.cocklin see this post , on how to correctly create&upload a drupal patch.
Comment #4
BD3 commentedEven though the patch is not in the proper format, I applied it manually and can confirm that this fixes the issue.
Comment #5
scott.whittaker commentedI can also confirm the patch works for me. I guess if someone can roll it into a valid patch we can quickly mark it RTBC and queue it for a future version :)
Comment #6
nkoporecRecreated @lee.cocklin patch to a proper format.Please reviewed it.
Comment #7
scott.whittaker commentedJust dropping a note here that this doesn't work when the form appears as in inline entity form.
I suspect that might be out of scope for this particular issue - I'm not sure if any conditional field stuff works as an inline entity form.
Comment #8
nkoporecYeah there is already an open issue.See it here Support for Inline Entity Form
Comment #9
icf-vpathak commentedThanks for the patch @nkoporec! It worked in my case.
Comment #10
scott.whittaker commentedWorks for me too
Comment #11
useernamee commentedHello, I reproduced the bug, applied the patch and the bug is gone. Changing status to RTBC.
Comment #12
useernamee commentedComment #13
thejimbirch commentedThe patch in #6 applied to dev works for me also.
Comment #14
m_z commentedThe patch #6 is great and makes the "Insert value from widget..." option working for checkboxes (by the way: the other options don't work either for checkboxes in the current version of conditional_fields module and Drupal 8.6).
Here are some modifications to the patch to match the Drupal coding standards:
I think that the solution of this patch should be transformed for the other "Set of values" options: "All these values (AND)..." etc.
Comment #15
m_z commentedI followed my suggestion to transform the solution of the #6 patch to the "Set of values" options (which I needed to show my target field if one of the term checkboxes (that match my specified term IDs in the conditional fields setting) of my "controlled by" field have been checked (and not all - what is the behavior of the "Insert value from widget..." if you set multiple options there).
I didn't create a patch because there are 2 open points (look for TODO in my comments in the code below), but I want to share my code which can be a basis for further work on this issue:
Some hints:
Comment #16
ahmad abbad commentedPatch #6 works for me
Comment #17
colanUpdating status based on #14. #15 looks like a good place to start for whoever's interested in working on this.
Comment #18
m_z commented@Colan: I can create a patch, but as stated in #15 there are 3 options that I didn't test because of missing experience how this options should work:
Perhaps you (or someone else) can help me with some test instructions how these options should behave.
Hypothetical setting:
"controlled by field": field_my_checkbox with 4 checkbox options:
- checkbox_option_1|Option 1
- checkbox_option_2|Option 2
- checkbox_option_3|Option 3
- checkbox_option_4|Option 4
"dependent field": field_my_dependent_textfield (that should be shown if the condition is met)
lets assume that the first 2 options should be selected in the conditional fields settings
for a) I have no idea how to test - so I need instructions
for b) field_my_dependent_textfield is visible if either "Option 1" or "Option 2" is checked, but NOT if both are checked, right?
for c) field_my_dependent_textfield is visible if neither "Option 1" nor "Option 2" nor both are checked, right?
Comment #19
colan@M_Z: I wish I could offer some help, but I'm not really all that familiar with that stuff. I became a maintainer mostly so I could clean up the queue, and then cut some needed releases so can't really comment on this aspect of it. (Also, it's been a while since I did look at any of the module's code as I no longer need this for any current projects.) Sorry!
Sounds like you're now the expert. ;)
Comment #20
pyxio commentedthis patch does not work for checkboxes on profiles.
Comment #21
m_z commented@colan: it seems that the patch (and my improvements for the patch) is not longer needed for versions greater or equal than alpha-6
I tested it in a project and everything is working fine without the patch (and the code is totally different between alpha-4 and alpha-6 which could explain why it works now without the patch).
So the issue could be closed?
Comment #22
colanGreat! Thanks for the analysis.
Comment #23
liquidcms commentedhmm.. so patch not requied in alpha6? that's unfortunate as it is still broken for me.
Comment #24
liquidcms commentedI have a hierarchical taxonomy and i had a couple modules being used to format it. I disabled the formatters to just display in default checkbox format and still conditional field has no impact.
Comment #25
liquidcms commentednope, my bad.. it is being broken when using the Term Reference Tree module and it's formatter.
Comment #27
liquidcms commentedthis is still broken for me.. but i am able to do what i need just use value and specifically setting the term id (this is for a term reference field set as checkboxes).
Comment #28
m_z commented@liquidcms : Can you please describe your configuration to make the error reproducable for others?
Comment #29
colanPlease create a new issue for that, if it's still a problem.