I have been playing with this for hours and have been unable to convert a simple node form from 4.6 to 4.7.
My original unaltered hook_form() looks like this:
function case_form(&$node) {
$output = '';
if (function_exists('taxonomy_node_form')) {
$output .= implode('', taxonomy_node_form('case', $node));
}
$output .= case_type($node);
return $output;
}
This calls custom callback and theme functions, which have been updated to 4.7:
function case_type($node) {
$servicetypes = array();
$servicetypes['0'] = '-- choose --';
$result = db_query("SELECT st.* FROM servicetype st ORDER BY st.servicetypeid");
while($row = db_fetch_array($result)) {
$servicetypes[$row['servicetypeid']] = $row['servicetype'];
}
$form['servicetype'] = array('#type' => 'fieldset', '#title' => t('Select Service Type'), '#tree' => TRUE);
$form['servicetype']['servicetypeid'] = array(
'#type' => 'select',
'#title' => t('Service'),
'#default_value' => $node->servicetypeid,
'#options' => $servicetypes,
'#required' => true);
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
$form['#method'] = 'post';
$form['#action'] = url('node/add/case');
return drupal_get_form('case_type', $form);
}
function theme_case_type($form) {
$output = '';
$output = '
';