Not sure if it's a bug or a feature request. Great module, BTW.
Steps to reproduce:
1.Create Entity Reference View which is filtered to contain only nodes of one content type (or any other filter, really).
2. Create Entity Reference Field to reference nodes.
3. Set Entity Reference Field to be filtered by Entity Reference View created in 1.
4. Under Form Display, set Inline Entity Form to permit referencing of existing nodes.
5. Now create or edit a node which contains the new Entity Reference Field:
Result: when populating the entity reference field, the autocomplete offers all nodes, and not just the nodes filtered by Entity Reference View.
The autocomplete for adding a new reference behaves correctly if in step 3 the 'default' method of selecting referenced nodes is chosen in field settings, instead of the entity reference view method.
The autocomplete as primary widget (instead of inline_entity_form with 'reference existing entity' enabled) does respect filtering by a an entity reference view, when that is set.
Comment | File | Size | Author |
---|---|---|---|
#5 | _module__make_inline_entity_form_respect_configured_view_in_entity_reference_field.patch | 787 bytes | tne_ |
|
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedThis was never supported in 7.x-1.x either. There's a patch in the queue for that, but it hardcodes a bunch of entity types. We need to solve it generically.
Comment #3
tne_ CreditAttribution: tne_ commentedThe attached patch should allow a configured entity view reference to be used.
Comment #5
tne_ CreditAttribution: tne_ commentedComment #6
tne_ CreditAttribution: tne_ commentedComment #9
bojanz CreditAttribution: bojanz at Centarro commentedThanks tne_, that did the trick.
We'll still want some kind that will restrict the bundles shown for "Add new" based on the view, but fixing "Add existing" is a good first step.