Warning: explode() expects parameter 2 to be string, array given in menu_node_submit() I get the above error after a creating a new content type.


  Warning: explode() expects parameter 2 to be string, array given in menu_node_submit()


The function which gives error is shown below :

function menu_node_submit($node, $form, $form_state) {
  // Decompose the selected menu parent option into 'menu_name' and 'plid', if
  // the form used the default parent selection widget.
  if (!empty($form_state['values']['menu']['parent'])) {
    list($node-&gt;menu['menu_name'], $node-&gt;menu['plid']) = explode(':', $form_state['values']['menu']['parent']);
  }
}

/**
 * Implements hook_form_FORM_ID_alter().
 *
 * Adds menu options to the node type form.
 */
The line that is throwing the error is in the core menu.module. The arguments that are getting passed to it are not valid. To troubleshoot it you would have to backtrace what is getting passed to it to see what is malforming the data or not creating proper data in the first place. If you use debug_backtrace you should be able to find where the bad data is originating from.

Specifically $form_state['values']['menu']['parent'] should be a string (to have explode work on it) but at that time, it is an array.