Problem/Motivation

There are still some lingering references to 'menu items' in the UI. These should be changed to 'menu links' for consistency.

Proposed resolution

Proposal: Change all occurrences of 'menu item' in the UI to 'menu link' for more consistency.

Remaining tasks

Locate and change UI strings

User interface changes

string change

API changes

n/a

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because Tasks are not functional bugs.
Issue priority Minor because this is a formatting change.
Unfrozen changes Unfrozen because it only changes strings in the UI
CommentFileSizeAuthor
#46 ui_rename_menu_items-290429-46.patch43.12 KBalvar0hurtad0
#44 290429-44.patch52.39 KBdruprad
#36 290429-36.patch52.22 KBpwolanin
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 96,520 pass(es). View
#32 ui_rename_menu_items-290429-32.patch52.13 KBmikeburrelljr
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch ui_rename_menu_items-290429-32.patch. Unable to apply patch. See the log in the details link for more information. View
#32 interdiff-ui_rename_menu_items-290429-28-32-do-not-test.diff35.63 KBmikeburrelljr
#28 ui_rename_menu_items-290429-28.patch12.53 KBmikeburrelljr
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,598 pass(es). View
#19 core_rename_menu_items_to_links_290429_19.patch11.94 KBepophoto
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch core_rename_menu_items_to_links_290429_19.patch. Unable to apply patch. See the log in the details link for more information. View
#17 rename_menu_items_to_menu_links_290429_17.patch28.77 KBmikeburrelljr
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,352 pass(es), 21 fail(s), and 0 exception(s). View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

pwolanin’s picture

Yes, this is a sad and confusing legacy of D5 which was not fully cleaned up in D6. The UI cleanup might help clarify the DX.

earnie’s picture

subscribe

Xano’s picture

Kick.

pwolanin’s picture

While basically everything in the UI could be thus renamed, menu_get_item() is actually getting a router item.

Xano’s picture

I stand corrected on that.

Bojhan’s picture

Status: Active » Closed (fixed)

fixed

earnie’s picture

Status: Closed (fixed) » Fixed

We mark it fixed first. It will close automagically in a cron execution.

Bojhan’s picture

Sorry, thanks for correcting my horrible mistake :P

pwolanin’s picture

Status: Fixed » Active

is this fixed? - I think we addressed much of the use in the UI elsewhere, but possible should still address the API

Bojhan’s picture

As far as I know did we change it to menu links - but I only know the UI.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev

If this was changed in the code, I do not know, but I do know that this won't get into 7.x. Moving to 8.x. Close if the changes have been made in the code as well.

jhedstrom’s picture

Issue summary: View changes

There are still a handful of references to 'menu items', in menu_ui help text and permission descriptions. Aside from that, the move to 'menu links' is almost complete.

pwolanin’s picture

Issue summary: View changes
Issue tags: +Novice

This seems like a simple task, but let's constrain it to UI strings.

jenmontgomery7’s picture

Drupalcon La Sprint - Working on this

jenmontgomery7’s picture

Looks fixed - May have been done already elsewhere

jhedstrom’s picture

Here's a list of files that expose 'menu items' in the UI:

  • core/modules/views/src/Plugin/views/display/Page.php
  • core/modules/menu_ui/menu_ui.module
mikeburrelljr’s picture

Status: Active » Needs review
FileSize
28.77 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,352 pass(es), 21 fail(s), and 0 exception(s). View

New contributor here, so any feedback is appreciated... #DrupalConLA

Replaced menu items verbiage for menu links in the following files:

  • modified: core/modules/menu_link_content/menu_link_content.routing.yml
  • modified: core/modules/menu_link_content/src/Entity/MenuLinkContent.php
  • modified: core/modules/menu_link_content/src/Tests/MenuLinkContentUITest.php
  • modified: core/modules/menu_ui/menu_ui.admin.js
  • modified: core/modules/menu_ui/menu_ui.module
  • modified: core/modules/menu_ui/menu_ui.permissions.yml
  • modified: core/modules/menu_ui/src/Controller/MenuController.php
  • modified: core/modules/menu_ui/src/Form/MenuDeleteForm.php
  • modified: core/modules/menu_ui/src/Tests/MenuLanguageTest.php
  • modified: core/modules/menu_ui/src/Tests/MenuNodeTest.php
  • modified: core/modules/menu_ui/src/Tests/MenuTest.php
  • modified: core/modules/menu_ui/src/Tests/MenuWebTestBase.php
  • modified: core/modules/views/src/Plugin/views/display/Page.php

Status: Needs review » Needs work

The last submitted patch, 17: rename_menu_items_to_menu_links_290429_17.patch, failed testing.

epophoto’s picture

Status: Needs work » Needs review
FileSize
11.94 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch core_rename_menu_items_to_links_290429_19.patch. Unable to apply patch. See the log in the details link for more information. View

I took a swing at this. The problem with #17 seems to be that changes were made to routes and functions instead of just to the UI. This patch only changes the ui strings in the files mentioned in #16 along with a few tests that asserted the language that had been changed.

This is my first contributed patch, so I apologize in advance if I stepped on any toes or messed anything else up here.

mikeburrelljr’s picture

Status: Needs review » Reviewed & tested by the community

@epophoto Tested via SimplyTest.me... This looks good to me. Thanks!

Patrick Storey’s picture

Issue tags: -Novice

I am removing the Novice tag from this issue because it looks the task has been completed.

I’m using this documentation as a source: https://www.drupal.org/core-mentoring/novice-tasks#avoid

Patrick Storey’s picture

Issue summary: View changes

Also gave this a Beta Evaluation so we can get this committed.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 19: core_rename_menu_items_to_links_290429_19.patch, failed testing.

epophoto’s picture

This looks like the test bot failed to start the test. This is my first patch so I am not sure what to do here, do I re mark it for review or is this automated failure part of the Beta Evaluation process....

The tests had all passed so I am not sure how to proceed...

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 19: core_rename_menu_items_to_links_290429_19.patch, failed testing.

jhedstrom’s picture

Issue tags: +Needs reroll

Patch no longer applies.

mikeburrelljr’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
12.53 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,598 pass(es). View

Re-rolling patch.

jhedstrom’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This looks great, thanks!

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thanks everyone for your work here! I've found a couple references to "menu item(s)" in user-facing strings still:

core/modules/forum/forum.module:      $output .= '<dd>' . t('Enabling the Forum module provides a default <em>Forums</em> menu item in the Tools menu that links to the <a href="!forums">Forums page</a>.', array('!forums' => \Drupal::url('forum.index'))) . '</dd>';
core/modules/toolbar/toolbar.info.yml:description: 'Provides a toolbar that shows the top-level administration menu items and links from other modules.'
core/modules/system/src/Plugin/Block/SystemMenuBlock.php:      '#description' => $this->t('The menu will only be visible if the menu item for the current page is at or below the selected starting level. Select level 1 to always keep this menu visible.'),
core/modules/shortcut/shortcut.module:      $output .= '<dd>' . t('You can display your shortcuts by enabling the <em>Shortcuts</em> block on the <a href="!blocks">Blocks administration page</a>. Certain administrative modules also display your shortcuts; for example, the core <a href="!toolbar-help">Toolbar module</a> provides a corresponding menu item.', array('!blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#', '!toolbar-help' => (\Drupal::moduleHandler()->moduleExists('toolbar')) ? \Drupal::url('help.page', array('name' => 'toolbar')) : '#')) . '</dd>';

Also, there are still a ton of references to "menu items" in code comments and occasionally test assertion messages. Wouldn't it make sense to add those changes to this patch as well so that the code documentation reflects what the user sees? The table descriptions in MenuTreeStorage can also be considered documentation.

Then there is the Menu UI permission: core/modules/menu_ui/menu_ui.permissions.yml: title: 'Administer menus and menu items'

Renaming this permission would require an upgrade path, so I agree that should be skipped in this issue (and might not be acceptable during the beta). However, let's create a followup issue for it. Edit: what I said before is wrong I think; the permission name is 'administer menu'. So that could probably be changed too.

I'd also skip over anything to do with Migrate as that seems to have to do with the D6 source code.

xjm’s picture

Oh, just a general note, please provide interdiffs when updating existing patches. Thanks!

mikeburrelljr’s picture

Issue tags: +JavaScript
FileSize
35.63 KB
52.13 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch ui_rename_menu_items-290429-32.patch. Unable to apply patch. See the log in the details link for more information. View

Updated many references to 'menu item(s)' through source. (Ignored core/modules/migrate_drupal references.)

Also, tagged as 'JavaScript' per recent suggestion from @nod_ in a similar thread (to track any changes to js files).

To do:
* Address 'administer menu' change suggested by xjm

mikeburrelljr’s picture

Status: Needs work » Needs review
jhedstrom’s picture

This is awesome mikeburrelljr, thanks!

One small nit:

+++ b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php
@@ -108,10 +108,10 @@ public function getDerivativeDefinitions($base_plugin_definition) {
+        // modes available for customisation. So we define menu link for all

This should be 'menu links' rather than just 'menu link'.

Status: Needs review » Needs work

The last submitted patch, 32: ui_rename_menu_items-290429-32.patch, failed testing.

pwolanin’s picture

Status: Needs work » Needs review
FileSize
52.22 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 96,520 pass(es). View

@xjm - UI should be done before string freeze, so let's not try to make this perfect in terms of code comments. I'd rather see UI changes happen in this issue, and address stray code stings in other (novice) issues.

Here's a re-roll to get the last patch to apply.

pwolanin queued 36: 290429-36.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 36: 290429-36.patch, failed testing.

epophoto’s picture

Status: Needs work » Needs review

Following the directions here https://www.drupal.org/patch/reroll

I performed a git apply --check on the patch and received no messages which should mean the patch is fine.

epophoto queued 36: 290429-36.patch for re-testing.

sushantpaste’s picture

Status: Needs review » Needs work
Issue tags: ++Needs reroll

Not able to apply patch #36.

sushantpaste’s picture

Issue tags: -+Needs reroll +Needs reroll
pwolanin’s picture

Version: 8.0.x-dev » 8.1.x-dev

This is a 8.1 or 9.0.x issue now due to string changes.

druprad’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
52.39 KB

Reroll for patch #36

sushantpaste’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Needs reroll against 8.1.x

alvar0hurtad0’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
43.12 KB

Here's the reroll, I've seen several uses of "menu item" on the code, but I've been focus on the reroll.

dawehner’s picture

Status: Needs review » Needs work

There are just some unoptimal changes but in general I like the idea of using menu link instead of menu item.

  1. diff --git a/core/CHANGELOG.txt b/core/CHANGELOG.txt
    index 761ed1d..7f8ada2 100644
    
    index 761ed1d..7f8ada2 100644
    --- a/core/CHANGELOG.txt
    
    --- a/core/CHANGELOG.txt
    +++ b/core/CHANGELOG.txt
    
    +++ b/core/CHANGELOG.txt
    @@ -79,7 +79,7 @@ Drupal 8.0, xxxx-xx-xx (development version)
    
    @@ -79,7 +79,7 @@ Drupal 8.0, xxxx-xx-xx (development version)
             environments.
         * Improved content language support:
           * Made it possible to assign language to taxonomy terms, vocabularies,
    -        menu items, and files.
    +        menu links, and files.
           * Added a field translation based content translation module that applies
             to all content entities.
           * Removed the old node-copy based content translation module.
    @@ -395,7 +395,7 @@ Drupal 6.0, 2008-02-13
    
    @@ -395,7 +395,7 @@ Drupal 6.0, 2008-02-13
           database rights.
         * Dynamically check password strength and confirmation.
         * Refactored poll administration.
    -    * Implemented drag-and-drop positioning for blocks, menu items, taxonomy
    +    * Implemented drag-and-drop positioning for blocks, menu links, taxonomy
           vocabularies and terms, forums, profile fields, and input format filters.
     - Theme system:
         * Added .info files to themes and made it easier to specify regions and
    @@ -496,7 +496,7 @@ Drupal 5.0, 2007-01-15
    
    @@ -496,7 +496,7 @@ Drupal 5.0, 2007-01-15
     ----------------------
     - Completely retooled the administration page
         * /Admin now contains an administration page which may be themed
    -    * Reorganised administration menu items by task and by module
    +    * Reorganised administration menu links by task and by module
         * Added a status report page with detailed PHP/MySQL/Drupal information
     - Added web-based installer which can:
         * Check installation and run-time requirements
    @@ -524,7 +524,7 @@ Drupal 5.0, 2007-01-15
    
    @@ -524,7 +524,7 @@ Drupal 5.0, 2007-01-15
         * Made it easy to investigate popular search terms.
         * Added a 'select all' checkbox and a range select feature to administration tables.
         * Simplified the 'break' tag to split teasers from body.
    -    * Use proper capitalization for titles, menu items and operations.
    +    * Use proper capitalization for titles, menu links and operations.
     - Integrated urlfilter.module into filter.module
     - Block system:
         * Extended the block visibility settings with a role specific setting.
    @@ -818,7 +818,7 @@ Drupal 4.5.1, 2004-12-01
    
    @@ -818,7 +818,7 @@ Drupal 4.5.1, 2004-12-01
     Drupal 4.5.0, 2004-10-18
     ------------------------
     - Navigation:
    -    * Made it possible to add, delete, rename and move menu items.
    +    * Made it possible to add, delete, rename and move menu links.
         * Introduced tabs and subtabs for local tasks.
         * Reorganized the navigation menus.
    

    Let's not change CHANGELOG.txt

  2. +++ b/core/LICENSE.txt
    @@ -320,7 +320,7 @@ when it starts in an interactive mode:
     The hypothetical commands `show w' and `show c' should show the appropriate
     parts of the General Public License.  Of course, the commands you use may
     be called something other than `show w' and `show c'; they could even be
    -mouse-clicks or menu items--whatever suits your program.
    +mouse-clicks or menu links--whatever suits your program.
     
    

    We should certainly not change the license.

  3. +++ b/core/modules/field_ui/field_ui.module
    @@ -127,7 +127,16 @@ function field_ui_entity_type_build(array &$entity_types) {
       // When a new bundle is created, the menu needs to be rebuilt to add our
    -  // menu item tabs.
    +  // menu link tabs.
    +  \Drupal::service('router.builder')->setRebuildNeeded();
    +}
    +
    +/**
    + * Implements hook_entity_bundle_rename().
    + */
    +function field_ui_entity_bundle_rename($entity_type, $bundle_old, $bundle_new) {
    +  // When a bundle is renamed, the menu needs to be rebuilt to add our
    +  // menu link tabs.
       \Drupal::service('router.builder')->setRebuildNeeded();
     }
     
    

    While this change is nice, it feels a bit out of scope ... ?

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.