Problem/Motivation
I need to reference products which have custom description associated so they can be more optimally described as add-on depending on the product they're add-on to.
To associate that text with the product reference, we can use https://www.drupal.org/project/entity_reference_override
but then that reference field doesn't appear as an option for the Pado formatter 'Add to cart form with add-ons' of the Variations field of a product.
Proposed resolution
Loosen the requirement for supported reference fields from the exact field type id to the type of items such reference field returns.
User interface changes
More options listed at the 'The product entity reference field to select add-ons from.' select box of the 'Add to cart form with add-ons' formatter configuration form.
No need to change its label and description because those are already generic enough.
API changes
None, AFAIK.
Data model changes
None, AFAIK.
Release notes snippet
Add support for Entity Reference Override fields and other field types that use \Drupal\Core\Field\EntityReferenceFieldItemList as their list_class instead of only supporting Drupal core's Entity reference field type.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | support_fields_that_return_EntityReferenceFieldItemList-3113263-2.patch | 1.01 KB | pieterdc |
Comments
Comment #2
pieterdcComment #3
japerryWorks for me. +1
Comment #5
japerry