Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#3 | fix-widget-settings-not-available-2445281-3.patch | 752 bytes | nagy.balint |
Comments
Comment #1
bsherwood CreditAttribution: bsherwood commentedI 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).
Comment #2
nagy.balint CreditAttribution: nagy.balint commentedThanks 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.
Comment #3
nagy.balint CreditAttribution: nagy.balint commentedFinally, 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.