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'.

Comments

pivica created an issue. See original summary.

pivica’s picture

Status: Active » Needs review
StatusFileSize
new2.02 KB

Here 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.

scott_euser’s picture

Status: Needs review » Reviewed & tested by the community

Works well for me, tested in both cases. Nice work and thank you for the contribution!

  • scott_euser committed 4736b71 on 8.x-1.x authored by pivica
    Issue #2849178 by pivica: Recipient type entity reference options does...
scott_euser’s picture

Status: Reviewed & tested by the community » Fixed
scott_euser’s picture

Status: Fixed » Closed (fixed)