The doc for node_example_form at http://drupaldocs.org/api/head/function/node_example_form contains an example taken from contributions/docs/developer/examples/node_example.module which no longer provides proper display:

The code goes:

function node_example_form(&$node) { 
  $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), 
// [...]
  return array_merge($form, filter_form($node->format)); 
}

which causes the Forms API to display the input filter form on its own, without a visual container (fieldset).

Is should rather be:

function node_example_form(&$node) { 
  $form['title'] = array('#type' => 'textfield', '#title' => t('Title'), 
// [...]
  $form['format'] = filter_form($node->format);
  return $form; 
}

If the doc is generated from code, the change should also be applied to contributions/docs/developer/examples/node_example.module.

(fix suggested by Morbus).

Comments

drewish’s picture

that looks good to me, can I get an Amen before we commit it?

add1sun’s picture

Status: Active » Closed (fixed)

Ancient 4.6 code and that example code has since been changed. Closing.