All custom menus can be renamed (not the machine name, that stays the same) but the human-readable name is editable. Why can't we allow the Main Menu to have it's human-readable name changed? Isn't it just a value in a db column?

Comments

malcomio’s picture

Category: support » feature
hpbruna’s picture

Status: Active » Needs review
StatusFileSize
new851 bytes

I don't now why. Someone said that it is because the names are used in code. But I can only find the machine-names in code. Therefor I created this simple patch that lets your edit the names of the system-menus. I haven't ran into any problems till now.

knalstaaf’s picture

Issue summary: View changes

I strongly support the idea of an editable default main menu name as well. It would come in very useful when the default language isn't English.

Thanks for the patch, this is working for me.

Would there be a way to do this with the template.php as well (so we don't have to patch this when updating the core)?

vikashsoni’s picture

StatusFileSize
new10.1 KB
new4.29 KB

@hpbruna thanks for this patch
it's working fine now we able to rename the main menu sharing screenshot

yashingole’s picture

Assigned: Unassigned » yashingole
yashingole’s picture

Assigned: yashingole » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new25.06 KB
new18.3 KB

Verified and tested patch #2 on Drupal 7.x. Patch was applied successfully and looks good to me.
Testing steps:
1. Install 7.x
2. Navigate to admin/structure/menu/manage/main-menu/edit
3. Main menu name is unable to edit.
4. Apply the Patch
5. Observe that the Main Menu name is editable
Testing Result:
1. After applying the patch the user can edit the main menu.
Can be move to RTBC
Screenshots are attached for reference:

poker10’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests, +Needs issue summary update

@yashingole Thanks for reviewing the patches. This one does not seems to be RTBC:

+    //'#access' => !isset($system_menus[$menu['menu_name']]),

According to the Drupal coding standards we cannot keep the commented line here.

The patch is also missing a test - it needs to be tested that the default menus (like the main-menu) have editable names after this change. Tha test should fail without applying this patch and pass with applied patch.

And possibly also the issue sumarry / title needs to be updated, because the IS mentions only "Main menu", but the patch is removing the protection from all default menus (see the variable $system_menus).

earthday47’s picture

I would be willing to modify the patch and create tests for this.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.