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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Riari’s picture

Confirmed, I've just been able to reproduce this with Conditional Fields 7.x-3.x-dev and Entity Reference 7.x-1.0.

lauriii’s picture

I cannot reproduce this

lauriii’s picture

Issue summary: View changes

clarifying

sylwester’s picture

same 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

PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'field_date_taken_passed_value' at row 1: INSERT INTO {field_data_field_date_taken_passed} (entity_type, entity_id, revision_id, bundle, delta, language, field_date_taken_passed_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 141 [:db_insert_placeholder_2] => 478 [:db_insert_placeholder_3] => training_record [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 2013-11-08 ) in field_sql_storage_field_storage_write() (line 451 of .../modules/field/modules/field_sql_storage/field_sql_storage.module). 
delacosta456’s picture

Issue summary: View changes

hi
same issue for me too..

tawellman’s picture

Having 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

dqd’s picture

Status: Active » Closed (cannot reproduce)
FileSize
1.47 MB

Same 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.

Liam Morland’s picture

In 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.