Commit e6d44cb5 authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #292790 by ag888, kjay, mr.baileys, recidive, malc0mn, jonathan1055,...

Issue #292790 by ag888, kjay, mr.baileys, recidive, malc0mn, jonathan1055, null: fix menu machine name validation form API constuct, so we don't need to validate it with custom code
parent dc65be5f
......@@ -409,7 +409,7 @@ function menu_edit_menu(&$form_state, $type, $menu = array()) {
$form['menu_name'] = array(
'#type' => 'textfield',
'#title' => t('Menu name'),
'#description' => t('The machine-readable name of this menu. This text will be used for constructing the URL of the <em>menu overview</em> page for this menu. This name must contain only lowercase letters, numbers, and hyphens, and must be unique.'),
'#required' => TRUE,
......@@ -509,9 +509,6 @@ function menu_edit_menu_validate($form, &$form_state) {
if (preg_match('/[^a-z0-9-]/', $item['menu_name'])) {
form_set_error('menu_name', t('The menu name may only consist of lowercase letters, numbers, and hyphens.'));
if (strlen($item['menu_name']) > MENU_MAX_MENU_NAME_LENGTH_UI) {
form_set_error('menu_name', format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."));
if ($form['#insert']) {
// We will add 'menu-' to the menu name to help avoid name-space conflicts.
$item['menu_name'] = 'menu-'. $item['menu_name'];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment