Commit 5e71caeb authored by stefan.r's avatar stefan.r

Issue #2578173 by Peacog, David_Rothstein, maximpodorov, marvin_B8, andypost,...

Issue #2578173 by Peacog, David_Rothstein, maximpodorov, marvin_B8, andypost, alexpott, tatisilva: Increase menu title maxlength to 255 in forms containing menu items
parent 3677ac5b
...@@ -50,6 +50,8 @@ Drupal 7.50, xxxx-xx-xx (development version) ...@@ -50,6 +50,8 @@ Drupal 7.50, xxxx-xx-xx (development version)
- Made method="get" forms work inside the administrative overlay. The fix adds - Made method="get" forms work inside the administrative overlay. The fix adds
a new hidden field to these forms when they appear inside the overlay (minor a new hidden field to these forms when they appear inside the overlay (minor
data structure change). data structure change).
- Increased maxlength of menu link title input fields in the node form and
menu link form from 128 to 255 characters.
Drupal 7.44, 2016-06-15 Drupal 7.44, 2016-06-15
----------------------- -----------------------
......
...@@ -281,6 +281,7 @@ function menu_edit_item($form, &$form_state, $type, $item, $menu) { ...@@ -281,6 +281,7 @@ function menu_edit_item($form, &$form_state, $type, $item, $menu) {
$form['link_title'] = array( $form['link_title'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Menu link title'), '#title' => t('Menu link title'),
'#maxlength' => 255,
'#default_value' => $item['link_title'], '#default_value' => $item['link_title'],
'#description' => t('The text to be used for this link in the menu.'), '#description' => t('The text to be used for this link in the menu.'),
'#required' => TRUE, '#required' => TRUE,
......
...@@ -674,6 +674,7 @@ function menu_form_node_form_alter(&$form, $form_state) { ...@@ -674,6 +674,7 @@ function menu_form_node_form_alter(&$form, $form_state) {
$form['menu']['link']['link_title'] = array( $form['menu']['link']['link_title'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Menu link title'), '#title' => t('Menu link title'),
'#maxlength' => 255,
'#default_value' => $link['link_title'], '#default_value' => $link['link_title'],
); );
......
...@@ -648,7 +648,12 @@ class MenuNodeTestCase extends DrupalWebTestCase { ...@@ -648,7 +648,12 @@ class MenuNodeTestCase extends DrupalWebTestCase {
); );
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
// Create a node. // Verify that the menu link title on the node add form has the correct
// maxlength.
$this->drupalGet('node/add/page');
$this->assertPattern('/<input .* id="edit-menu-link-title" .* maxlength="255" .* \/>/', 'Menu link title field has correct maxlength in node add form.');
// Create a node with menu link disabled.
$node_title = $this->randomName(); $node_title = $this->randomName();
$language = LANGUAGE_NONE; $language = LANGUAGE_NONE;
$edit = array( $edit = array(
...@@ -684,6 +689,10 @@ class MenuNodeTestCase extends DrupalWebTestCase { ...@@ -684,6 +689,10 @@ class MenuNodeTestCase extends DrupalWebTestCase {
$this->drupalGet('node/' . $node->nid . '/edit'); $this->drupalGet('node/' . $node->nid . '/edit');
$this->assertOptionSelected('edit-menu-weight', 17, 'Menu weight correct in edit form'); $this->assertOptionSelected('edit-menu-weight', 17, 'Menu weight correct in edit form');
// Verify that the menu link title on the node edit form has the correct
// maxlength.
$this->assertPattern('/<input .* id="edit-menu-link-title" .* maxlength="255" .* \/>/', 'Menu link title field has correct maxlength in node edit form.');
// Edit the node and remove the menu link. // Edit the node and remove the menu link.
$edit = array( $edit = array(
'menu[enabled]' => FALSE, 'menu[enabled]' => FALSE,
......
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