Skip to content

Commit

Permalink
Issue #3592: Change the weight field in the taxonomy term form to a n…
Browse files Browse the repository at this point in the history
…umber field.

By @klonos and @herbdool.
  • Loading branch information
klonos authored and quicksketch committed Apr 9, 2019
1 parent b11187f commit 0ee36a3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/modules/taxonomy/taxonomy.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,8 @@ function taxonomy_form_term($form, &$form_state, TaxonomyTerm $term = NULL, Taxo
);

$form['relations']['weight'] = array(
'#type' => 'textfield',
'#type' => 'number',
'#title' => t('Weight'),
'#size' => 6,
'#default_value' => $term->weight,
'#description' => t('Terms are displayed in ascending order by weight.'),
'#required' => TRUE,
Expand Down Expand Up @@ -905,11 +904,6 @@ function taxonomy_form_term($form, &$form_state, TaxonomyTerm $term = NULL, Taxo
*/
function taxonomy_form_term_validate($form, &$form_state) {
entity_form_field_validate('taxonomy_term', $form, $form_state);

// Ensure numeric values.
if (isset($form_state['values']['weight']) && !is_numeric($form_state['values']['weight'])) {
form_set_error('weight', t('Weight value must be numeric.'));
}
}

/**
Expand Down

1 comment on commit 0ee36a3

@backdrop-ci
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.