Allow migrating <none> <button> url special menu items and empty string.

Created on 24 January 2022, almost 3 years ago
Updated 16 January 2025, 5 days ago

Problem/Motivation

The link_uri migrate process plugin provided by the core menu_link_content module provides handling for links referencing the special <front> and <nolink> routes but does not currently support the special <button> route added in 8.8 ( https://www.drupal.org/node/3053689 β†’ ).

When migrating into menu links url field I receive the following error.

 -------------- ------------------- ------- --------------------------------------------------------------- 
  Source ID(s)   Destination ID(s)   Level   Message                                                        
 -------------- ------------------- ------- --------------------------------------------------------------- 
  1                                  1       The path "internal:/<button>" failed validation.               

Steps to reproduce

in my migration_name.yml file I am using the menu_link_content process

process:
  bundle: menu_link_content
  title: title
  menu_name: menu
  # Handle external urls or url aliases.
  'link/uri':
    plugin: link_uri
    source: urlpath

In my source migration_name.json file

{
  "menu_links": [
    {
      "link_id": "1",
      "parent_link_id": "0",
      "menu": "az-resource-menu",
      "title": "Resources",
      "urlpath": "<button>",
      "external": false,
      "expanded": true,
      "enabled": true,
      "weight": "1"
    },

Proposed resolution

Add the supported special route to https://git.drupalcode.org/project/drupal/-/blob/9.4.x/core/modules/menu...

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Add the ability to migrate the following menu item types <button>, <none>,''.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component

migration system

Created by

πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024