I'm upgrading from Drupal 6
to Drupal 7
. I enabled this module after updating it.
Here's my function:
function sport_utils_form_alter($form, $form_state, $form_id) {
if (strpos($form_id, '_node_form') !== FALSE) {
$form['#validate'][] = 'byu_sport_utils_verify_valid_author';
$form['#validate'][] = 'byu_sport_utils_remove_first_line_break';
$form['top_buttons'] = $form['buttons'];
$form['top_buttons']['#weight'] = -500;
$form['top_buttons']['#prefix'] = $form['buttons']['#prefix'] = '<div class="button-bar">';
$form['top_buttons']['#suffix'] = $form['buttons']['#suffix'] = '</div><div class="clear"></div>';
}
}
It's throwing an error on this line:
$form['top_buttons'] = $form['buttons'];
I can't find out if I need to replace $form['buttons']
with something else that works in Drupal 7.
Any suggestions?
In Drupal 7 the form buttons are grouped under
$form['actions']
. So you need to modify your code to support that like below.