Problem: Enabling conditional field dependeny on an entity reference field type using autocomplete will cause that specific field to not be saved or updated. The rest of the node and its fields get saved/updated. Disabling the conditional field module (dependency) on the affected field resolves the issue.
In short, there is something that the conditional fields module is doing that is preventing the saving and updating of an entity reference + autocomplete field type.
The workaround is to just avoid creating a dependency with the conditional field module. If you really need to show/hide a field visually without any fancy validations or checks, then write your own jQuery conditions until this is fixed.
More information:
entity type: node
field type: entity reference with autocomplete targeting a node
conditional field dependencies: show a field when a checkbox is a certain value
possible module interferences: entity reference module
Comment | File | Size | Author |
---|---|---|---|
#6 | 1959170-dependency_entity_reference_autocomplete_does_not_work.gif | 1.47 MB | dqd |
Comments
Comment #1
Riari CreditAttribution: Riari commentedConfirmed, I've just been able to reproduce this with Conditional Fields 7.x-3.x-dev and Entity Reference 7.x-1.0.
Comment #2
lauriiiI cannot reproduce this
Comment #2.0
lauriiiclarifying
Comment #3
sylwester CreditAttribution: sylwester commentedsame here. for me it actually is for all widgets. this is in combination with date field.
removing date field solves the problem.
effects only node/add. node is added event though initially drupal render db error below. then node edit saves without any problems
Comment #4
delacosta456 CreditAttribution: delacosta456 commentedhi
same issue for me too..
Comment #5
tawellman CreditAttribution: tawellman as a volunteer commentedHaving the similar issue on a Reference Field.
If I use a Condition dependent on a text field, it works. Dependent on a Taxonomy Reference field, with autocomplete widget, it does not work. If I switch to a "Select List" Widget it works.
Don't see any issues for the version I am using. So posting this here for now.
Using Drupal 9.0.6
Conditional Fields Version: 8.x-1.0-alpha9
Comment #6
dqdSame here like in #2:
I cannot reproduce the issue. Look at the screen cast I did for you guys. But only for latest 4.x dev, since we do not have no Drupal 7 test environments no more and most 7.x issues which do not have a reviewable patch or progress will be closed since Drupal 7 EOL is in Jan. 2025.
So by saying: Thanks for the report and all the efforts in here. But due to upcoming EOL of Drupal 7, I will close this issue on the way by cleaning up the issue queue.
Feel free to re-open as "Needs review" if you found a solution or have a patch to be reported and ported to help others on this outdated version.
If you think this issue or missing feature should be addressed in a newer Drupal core 8 and above compatible version of this project, then please file a new issue to the latest dev with a detailed report to reproduce and work on. Thanks for understanding.
Comment #7
Liam MorlandIn Drupal 10, I found that for conditionals controlled by entity reference fields, "Insert value from widget" does not work. It worked when I replaced that with "Any of these values" and entered the one desired value.