Problem/Motivation
It seems that at some point since #2723893: Merge Webforms "OptionEmailtem" feature into Contact Storage was implemented, the default options/list widget and formatter have become more exclusive in its handled field types. This results in there not being a proper widget or formatter to edit or display the values (see attached screenshots).
Interestingly enough, the field is displayed properly directly after installation, but only as long as the form/display settings of the contact form are not re-saved.
Proposed resolution
Implement hook_field_formatter_info_alter
and hook_field_widget_info_alter
to re-use the default handlers.
/**
* Implements hook_field_formatter_info_alter().
*/
function contact_storage_field_formatter_info_alter(&$info) {
// Let our options_email field type re-use the default list formatter.
$info['list_default']['field_types'][] = 'contact_storage_options_email';
}
/**
* Implements hook_field_widget_info_alter().
*/
function contact_storage_field_widget_info_alter(&$info) {
// Let our options_email field type re-use the default options widget.
$info['options_select']['field_types'][] = 'contact_storage_options_email';
}
Comment | File | Size | Author |
---|---|---|---|
#2 | new_optionemailtem-2753731-2.patch | 3.08 KB | Bambell |
| |||
contact_storage_options_email_3.png | 18.15 KB | ckaotik | |
contact_storage_options_email_2.png | 22.21 KB | ckaotik | |
contact_storage_options_email_1.png | 5.69 KB | ckaotik |
Comments
Comment #2
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedGreat catch. I added the changes you suggested and added more tests as well (change the form, save it and verify that changes are visible). Reproduced the problem and locally verified that it was fixed as well.
Comment #3
BerdirI know we discussed doing this, not sure how we all missed it.
Comment #4
larowlanthanks