You are here

function commerce_message_message_form_submit in Commerce Message 7

Submit callback for commerce_message_message_form().

1 string reference to 'commerce_message_message_form_submit'
commerce_message_message_form in includes/commerce_message.message.inc
Form callback: create/edit a message.

File

includes/commerce_message.message.inc, line 592

Code

function commerce_message_message_form_submit($form, &$form_state) {

  // Update date to current one
  $form['#entity']->timestamp = REQUEST_TIME;

  // Notify field widgets.
  field_attach_submit('message', $form['#entity'], $form['content'], $form_state);
  entity_save('message', $form['#entity']);
  drupal_set_message(t('Message saved.'), 'status', FALSE);

  // Kill the user input so that we can save a new message.
  $form_state['input'] = array();
  $form_state['rebuild'] = TRUE;
}