Hello,

I tried to manage the display of my message using display suite. I have simple message to display and only want to keep the Default display, but when I delete all the others display, I get an error message on the message edit page :

    Notice: Undefined index: default in message_field_attach_form() (line 505 of D:\***\Drupal\sites\all\modules\message\message.module). Backtrace:
    message_field_attach_form('message_type', Object, Array, Array, 'en') field.attach.inc:580
    field_attach_form('message_type', Object, Array, Array, 'en') message.admin.inc:297
    message_type_form(Array, Array, Object, 'edit', 'message_type')
    call_user_func_array('message_type_form', Array) form.inc:798
    drupal_retrieve_form('message_type_edit_commerce_order_message_form', Array) form.inc:339
    drupal_build_form('message_type_edit_commerce_order_message_form', Array) entity.module:1095
    entity_ui_get_form('message_type', Object)
    call_user_func_array('entity_ui_get_form', Array) menu.inc:517
    menu_execute_active_handler() index.php:21
    Notice: Undefined index: default in message_field_attach_form() (line 505 of D:\***\Drupal\sites\all\modules\message\message.module). Backtrace:
    message_field_attach_form('message_type', Object, Array, Array, 'en') field.attach.inc:580
    field_attach_form('message_type', Object, Array, Array, 'en') message.admin.inc:297
    message_type_form(Array, Array, Object, 'edit', 'message_type')
    call_user_func_array('message_type_form', Array) form.inc:798
    drupal_retrieve_form('message_type_edit_commerce_order_message_form', Array) form.inc:339
    drupal_build_form('message_type_edit_commerce_order_message_form', Array) entity.module:1095
    entity_ui_get_form('message_type', Object)
    call_user_func_array('entity_ui_get_form', Array) menu.inc:517
    menu_execute_active_handler() index.php:21

Any idead how to fix it ? Is message not compatible with display suite ? I thought it was as it integrate entity API and should not be different than all others entities that perfectly works with DS

Regards,

Alex

Comments

Version:7.x-1.6» 7.x-1.7

This error also occurs in 1.7 stable release if there are visible fields in the default display mode.

This bug appears to be from an upgrade of a previous version of message involving message types defined in that older module.

From the api documentation:

display: An associative array whose keys are the names of extra fields, and whose values are associative arrays keyed by the name of view modes. This array must include an item for the 'default' view mode.

It appears at some point default was defined, but no longer. Uninstalling message/message notify and re-enabling the modules resolved this issue.

Perhaps an update should be made that sets the bundle settings to remove the default, or it should be ignored in message_field_attach_form() of the module.