Hello,
The visibility of my user-reference select-list depends on another drop-down. The show/hide feature works; however, when you save the node, the selected values of the user-reference select-list ultimately do not get saved. Please help. Very urgent need.
Thanks!

CommentFileSizeAuthor
#8 dependency config.jpg51.08 KBjag339
#8 form.jpg5.6 KBjag339
#7 cfields.jpg92.93 KBVagabondo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

peterpoe’s picture

Cannot reproduce this, it works fine for me with latest References 2.x-dev.
Do you mean that values don't get saved when the user reference field is triggered/visible? In this case, it's a bug.
If values don't get saved when the user reference field is untriggered/hidden, this is by design. We can't submit values that don't get validated.

Vagabondo’s picture

Same problem here: show/hide works, but values don't get saved when the user reference field is triggered/visible.
Everything worked perfectly till I updated to the last dev a few days ago.

peterpoe’s picture

I need more information to debug this:
- Fields settings: field/widget types, etc...
- Dependencies settings
- Other settings that might have an impact, like Field Permissions module...

swortis’s picture

For me:

I'm using a boolean field as the Dependee and the body field as the Dependent. Boolean field ("This post is a photo gallery with no text"), if activated, hides the body field intake with a slidedown (dependency text reads: "body is invisible when field_gallery_only is checked".

No matter what the user setting, no body text is ever saved. The node is saved, but nothing is saved in the body field.

Not using Field Permission module.

-S

peterpoe’s picture

Title: show/hide works but the field-values never get saved » Field values are never saved when dependency condition is other than "Value"
Status: Active » Fixed

The problem reported in #4 was fixed in dev, thanks for the details. If the fix doesn't solve the other errors, feel free to reopen the issue.

Note for #4: If you use the "Checked" or "Unchecked" conditions, the dependency has no effect on node view. This will be corrected asap, but in the meanwhile you can obtain what you want by using the "Value" condition.

swortis’s picture

Thanks!

Vagabondo’s picture

Status: Fixed » Active
FileSize
92.93 KB

Unfortunately last dev doesn't fix it for me. Here are full details of my issue.

First of all, Conditional Fields worked perfectly on my site a few weeks ago, before one of the last updates.
My site is not in production yet, but at the beginning of April I did some testing and got positive results.

How I use it. I use C.F. to provide some additional fields to forum posts depending on the forum (ie: event-forum asks for a date). So the dependee is always and only the value of taxonomy_forums and uses a select widget.
Dependant fields can be of every kind: taxonomy widget, select, text fields, dates and an openlayer input.
I attach a screenshot of my manage dependencies tab.
Other modules and permission: I'm using Taxonomy Access Control to get one private forum. The two additional fields of that forum show and hide correctly. There are no field-based permission.

What happens. When I add a new post and change the forum in the select-input, everything woks fine: fields hide and show correctly, and the required ones show the red "*".
But when I click on "Save" the post saves without any value in the fields managed by Conditional Fields.
I've just noticed that the post saves even if no value is entered in the fields that are set as required by C.F.

Hope this info are useful... Anyway, the idea of conditional fields is genial, thank you for this great module :-)

jag339’s picture

FileSize
5.6 KB
51.08 KB

Hi peterpoe,

I am using the latest conditional_fields 7.x-3.x-dev.
Values do not get saved when the user reference field is visible.
I'll include screenshots of how I set up the conditions, as well as the custom content type.
What happens is -- if I select "No", I get to save the content type no problem; all is happy-happy.
If I select "Yes" and then select my people from the user-reference field, and then save the content type, none of my user data is saved in the content type :(

Hopefully this is clear. Otherwise this looks to be a great module. I'm hoping you can help iron out this last little piece.

Thanks!

rteuber’s picture

I can confirm the issue.

Bolean field as dependent and values in fields that was changed to "Visible" by the module are not saved unless you revert the selection and make the field invisible again. After deleting condition field is saved as it should be.
Happens with Text, File, Bolean fields.

Vagabondo’s picture

Title: Field values are never saved when dependency condition is other than "Value" » show/hide works but the field-values never get saved
Priority: Normal » Major

I'm changing title because my dependency conditions are values, but field content is not saved anyway.
Setting priority to major as this bug makes the module unusable :-(
The version of about 1 month ago worked perfectly on my site: could be possible to get it back until the new one get fixed?
Let me know if I can provide any useful info.
Bye

jag339’s picture

Hello rteuber - What do you mean "revert the selection"? I checked the box that says "Reset the dependent to its default values when the form is submitted if the dependency is not triggered." But the user selection field values still are not saved.
I agree with Vagabondo - this bug makes the module unusable :-(

lucashodge’s picture

I found that using the 'Values input mode' default 'Insert value from widget...' selection method would cause the error. I managed to get the module to work by changing the selection to 'All these values (AND)..' and entering the key manually.

Vagabondo’s picture

Thank you lucashodge, I made some testing and it seams to save the fields with "All these values (AND)" and with "Any of these values (OR)".
It doesn't work with "None of these values (NOT)" (that was the setting I was using) and with the widget.

rmarius’s picture

Yes, this fix is working, thanks.

bagozonde’s picture

On beginning everything just works ok, but after some time I found fields I can't save and other ones (with that same non-conditions kind) just saved well. Even mandatory field wasn't possible to save and no warning displayed that field was required. So I found solution in settings of Conditional fields: just switch off "Reset untriggered fields to default values" and everything works fine for now. I'm using Conditional Fields 6.x-2.0 with Content 6.x-3.x-dev.

bombadillo’s picture

The issue here is for 7.x version.
I think you posted in the wrong place.

mindaugasd’s picture

The same problem here. Fields are not saved.

1. For testing I disabled **all** the contrib modules, still not working.
2. if condition is "HAS value" and field is "LIST(TEXT) type, when things don't work. If I choose a different type, for example "checked", when things work.
3. Tried the same thing on a different content type - not working.

mindaugasd’s picture

#13 solution worked :)

klokie’s picture

I can also confirm that the solution described in #13 works, as does "values input mode" = "Only one of these values (XOR)" and "Interaction with other dependencies" = "XOR".

qasimzee’s picture

Getting the same issue. Not working with AND, OR or XOR. Downloaded the latest dev release but still getting the same issue

adamtong’s picture

I also have the same problem. I am using the latest 7.x dev version. When I create dependency, it works fine in the editing node. However, the values never saved and shown.

Please help. it is urgent for me to use this.

Thank you in advance.

test_drupal15’s picture

Assigned: Unassigned » test_drupal15
Issue tags: +default value, +dependent field
test_drupal15’s picture

Assigned: test_drupal15 » Unassigned
Priority: Major » Critical

dependent field visible/invisible functionality is working fine but when i submit data, value of dependent field is not gets saved.(or gets saved to default value).

Scenario is as follow:
Dependee : have address (check box)
Dependent field : country (select list)

here selected country is not gets saved.

I also tried solutions given in above discussion but still have same problem.
Have any solution????
Thanks in advance.

test_drupal15’s picture

Status: Active » Fixed

#23 is fixed. Here in to dependent field I used select list with option Allowed values list to give values.
e.g.
1|India
2|US
3|China

and Dependent field having field'Select List' as WIDGET and 'List (text)' as FIELD.

dependee (have address) field's values:
1|Yes
2|No
3|Not Sure

Dependencies:
1. Country is invisible when have_address has at least one of the values: 2, 3.
2. Country is visible when have_address has value "1".

After these setting everything is working fine.

peterpoe’s picture

I suspect that the issues reported in #8 and #13 are not bugs but intended behavior of the module. It's a bit counter-intuitive, but this is how it works: when a dependency is triggered if a field is invisible, of course it's not triggered if the field is visible. When a dependency is not triggered, the dependent field is completely ignored on form submission, and the values are not saved (otherwise, we would have to validate them, and possibly trigger validation errors on untriggered dependents, or even worse, save invalid values!).

To solve your problems, it should be sufficient to set up a dependent as "visible" when the dependee is "Yes".

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

arancedisicilia’s picture

That finally was the solution! Thanks a lot!

francoud’s picture

Issue summary: View changes

I've the same problem but none of previous solutions seem working for me. Situation is quite simple:
- one content type, two fields
- first field, a list with several values:
- "unused"
- "value1"
- "value2"
- ...
- Second field, a simple text fiels.

I want: the second field be not visibile if the first field is "unused"; but visible (and being saved) in all other cases.

Visibility works with a simple condition: invisibile when first field is "unused". Second field is visible in all other cases. But it is not saved.

I cannot create a second condition: visible when first field is "value1", and "value2".. etc... because those values could change in different times. I also tried, two conditions in AND:
- invisibile when first field is "unused"
AND
- visibile when first field has none of the values "unused".

Again, visibility is OK but field is not get saved...

Thanks for any help!

victorascencioh’s picture

I've the same problem but none of previous solutions seem working for me. Situation is quite simple:
- one content type, two fields, both are List(text) and widget are select list.
-first field:
1| L
2|A
3|M
-second field:
1| 0700-0759
2| 0800-0859
3|0900-0959

I want: the second field be visible if the first field was select 1|L, before i choose insert value from widget, but when i did that, the value chosen from second field, never get saved.
So, what did i do?...
Instead of choose "value from widget" i chosen All these values(AND) and set of values: 1.

That was it.
Now when I save the content, it also saves my selected field from the second field.
Thanks for any help!

dirckdigler’s picture

it doesn't work for me, even #13 and #29. I chosen All these values(AND)
I set this values like this:

field "option"
1|L
2|A
3|M

When I select 1|L must visible only one field call "father". Obviously the field select has been created with this values by default (1|L, 2|A, 3|M), but not save.