Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Dende-1 on
I found a bug in the theme_button function in form.inc at line 964
i change where puts $element['#button_type'] for $element['#type'], if you don't make that the class is empty like class="form- "
If it isn't a bug sorry for the problems.
function theme_button($element) {
//Make sure not to overwrite classes
if (isset($element['#attributes']['class'])) {
//$element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
$element['#attributes']['class'] = 'form-'. $element['#type'] .' '. $element['#attributes']['class'];
}
else {
//$element['#attributes']['class'] = 'form-'. $element['#button_type'];
$element['#attributes']['class'] = 'form-'. $element['#type'];
}
return '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
}