When you have entity reference to some content with email field and you are using view entity reference for this stuff does not work. Problem is in ContactEmails::getEntityReferenceEmailFields() method because $settings format is a bit different when view is used for entity reference. Except of generated PHP error in this case user can not select email field for 'Recipient field in reference'.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | entity-reference-as-view-support-2849178-1.patch | 2.02 KB | pivica |
Comments
Comment #2
pivica commentedHere is a patch. Changed code in getEntityReferenceEmailFields() so it cover both cases of entity reference method (default and view).
Also improved labels in select box for 'Recipient field in reference' form field and added there also field machine name info. Did this because having use case with multiple contact forms and they are all using the same default email field which is coming with contact module. In the case like this for 'Recipient field in reference' field you have options like
Country: Email
Country: Email
Country: Email
Country: Email
Country: Email
Country: Email
And this is not very helpfull for site admin. Now with additional info in options it select looks like
Country: Email (field_email)
Country: Email (field_aky_email)
Country: Email (field_bsn_email)
Country: Email (field_oc_email)
Country: Email (field_pm_email)
Country: Email (field_sm_email)
Which is much better.
Comment #3
scott_euser commentedWorks well for me, tested in both cases. Nice work and thank you for the contribution!
Comment #5
scott_euser commentedComment #6
scott_euser commented