diff --git a/core/modules/menu_link_content/src/Plugin/migrate/process/LinkUri.php b/core/modules/menu_link_content/src/Plugin/migrate/process/LinkUri.php index 04d189a713ed6e027d0528929c553c952047dc13..82e2d985c3b666e94e25a92dec7ad1fa3f489fc5 100644 --- a/core/modules/menu_link_content/src/Plugin/migrate/process/LinkUri.php +++ b/core/modules/menu_link_content/src/Plugin/migrate/process/LinkUri.php @@ -93,9 +93,12 @@ public function transform($value, MigrateExecutableInterface $migrate_executable if ($path == '<front>') { $path = ''; } - elseif ($path == '<nolink>') { + elseif (empty($path) || in_array($path, ['<nolink>', '<none>'])) { return 'route:<nolink>'; } + elseif ($path == '<button>') { + return 'route:<button>'; + } $path = 'internal:/' . $path; // Convert entity URIs to the entity scheme, if the path matches a route diff --git a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php index ed45cbe4571123a41124c58c313b39caf02d0662..0c68d3d310c386ed5d5b8d18634825d3b6de36d8 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php @@ -73,10 +73,22 @@ public static function providerTestRouted() { $expected = 'internal:/'; $tests['front'] = [$value, $expected]; + $value = ''; + $expected = 'route:<nolink>'; + $tests['empty'] = [$value, $expected]; + + $value = '<none>'; + $expected = 'route:<nolink>'; + $tests['none'] = [$value, $expected]; + $value = '<nolink>'; $expected = 'route:<nolink>'; $tests['nolink'] = [$value, $expected]; + $value = '<button>'; + $expected = 'route:<button>'; + $tests['button'] = [$value, $expected]; + return $tests; }