Problem/Motivation
Despite what the readme says, the module does work if the parent is an autocomplete widget. The code to extract the parent target ID from an autocomplete widget does exist, but it's not working as expected. The issue is in DynamicReferenceSelectionViewsSelection::updateDependentField, the preg_match pattern does not match the formatting of an entity reference autocomplete value.
Steps to reproduce
- Set up an entity with two entity reference fields, the parent as an autocomplete and child as a select.
- Set up the child to use dynamic_reference_selection with a view. The returned options don't matter as long as selecting a parent value causes the view options to change.
- Create a new entity with the above type, update the value of the parent to kick off the child's options changing.
Expected: Child options change with parent.
Actual: Child options remain empty.
Proposed resolution
- Fix the pattern.
Remaining tasks
- patch
- test
- review
User interface changes
- none
API changes
- none
Data model changes
- none
Issue fork dynamic_reference_selection-3572941
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
fskreuz commented