The operation "Add" is missing on the Translate page of a menu item

Created on 18 March 2024, 9 months ago

On the Translate page for a menu item:
/admin/structure/menu/item//edit/translations

The operation "Add" is missing from any menu item that hasn't been translated yet, which in my case is the majority of them. Obviously, under the Admin account it is not missing. I need to be able to give users access to add a translation for a menu item.

πŸ’¬ Support request
Status

Active

Version

1.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bobthebuilder

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bobthebuilder
  • πŸ‡ΊπŸ‡ΈUnited States bobthebuilder

    I see in the code that the route for Adding translation is there and is getting the custom permission set:

    case 'entity.menu_link_content.canonical':
            case 'entity.menu_link_content.delete_form':
            case 'entity.menu_link_content.content_translation_overview':
            case 'entity.menu_link_content.content_translation_add':
            case 'entity.menu_link_content.content_translation_edit':
            case 'entity.menu_link_content.content_translation_delete':
              $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menuItemAccess']);
              break;

    So I'm not sure why the "Add" button is missing next to menu items.

  • πŸ‡ΊπŸ‡ΈUnited States bobthebuilder

    I just figured it out. It turns out you need to enabled the permission "Manage translations for any entity that the user can edit".

Production build 0.71.5 2024