The default message it not being added to the emails and I get the following error.

Notice: Undefined index: widget_settings in email_contact_mail_page_form() (line 386 of /public_html/sites/all/modules/email_contact/email_contact.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bsherwood’s picture

I am also receiving this error on form submit as well. I am using the same version (7.x-1.0-rc1) as the OP.

Notice: Undefined index: widget_settings in email_contact_mail_page_form_submit() (line 428 of /home/dev/testsite/sites/all/modules/email_contact/email_contact.module).

nagy.balint’s picture

Thanks for the report.

Unfortunately these notices are quite weird.

Because in the first report in email_contact_mail_page_form the widget_settings only appears once, and its in if (!isset($form_state['widget_settings'])) {
which should not throw a notice.
And then if its undefined it will set the index.

Then the second report says that its undefined in the submit, but in fact in this form definition it should always be defined.

nagy.balint’s picture

Status: Active » Needs work
FileSize
752 bytes

Finally, figured out the issue.

At this moment the page has no idea about which display the entity has when rendering the form (in the case of the link formatter the view mode is not in the url for example), so it has no way of figuring out from which view mode to get the widget settings.

It seems before it simply stopped at the first view mode, and if that view mode was used all was fine.

Improved the code a bit to only consider our own formatters, and so it will always pull a widget setting that has these values.

But the issue still remains with this, as now if you have two view modes that are configured differently, then it will still pull the wrong data... So this issue will remain needs work even after the commit.

  • nagy.balint committed 22a4d79 on 7.x-1.x
    Issue #2445281 by nagy.balint, bsherwood, jphelan: Default Message not...