Problem/Motivation
When using the module to update field data, not all changes are saved.
Steps to reproduce
- Create an entity reference field (such as a taxonomy term).
- Set the field to use autocomplete
- Create an entity reference field (such as a taxonomy term).
- Set the field to use a select list
- Bulk update field content for a node that uses those fields
- Change the values of both
- Only the autocomplete change is saved
Proposed resolution
Investigate how field data is processed -- likely the `target_id` of the widget.
Ensure proper handling of select fields.
Note that this may solve https://www.drupal.org/project/bulk_update_fields/issues/3363620 and https://www.drupal.org/project/bulk_update_fields/issues/3185661 as well.
Remaining tasks
Find the problem
Fix the problem
Time permitting, write a test
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3367716-bulk_update_fields-default-value.patch | 1008 bytes | agentrickard |
| #3 | Screenshot 2023-06-19 at 2.59.36 PM.png | 52.97 KB | agentrickard |
Comments
Comment #2
agentrickardHere's the form data for the two types.
Autocomplete:
Select:
Comment #3
agentrickardI tracked this down to a mismatch in the default_value_input and form input values. (See attached screenshot).
This patch fixed it for me, but I suspect there may be a better fix, perhaps in this part of `buildForm`:
Other parts of this IF/ELSE set the field value, but know what widget they are targetting