diff --git a/core/modules/menu_link_content/migration_templates/d6_menu_links.yml b/core/modules/menu_link_content/migration_templates/d6_menu_links.yml index 1aaae76..c418bfe 100644 --- a/core/modules/menu_link_content/migration_templates/d6_menu_links.yml +++ b/core/modules/menu_link_content/migration_templates/d6_menu_links.yml @@ -15,6 +15,9 @@ process: migration: d6_menu source: menu_name - + plugin: skip_on_empty + method: row + - plugin: static_map map: management: admin diff --git a/core/modules/menu_link_content/migration_templates/d7_menu_links.yml b/core/modules/menu_link_content/migration_templates/d7_menu_links.yml index acf3b22..8581e2c 100644 --- a/core/modules/menu_link_content/migration_templates/d7_menu_links.yml +++ b/core/modules/menu_link_content/migration_templates/d7_menu_links.yml @@ -12,9 +12,13 @@ process: title: link_title description: description menu_name: - plugin: migration - migration: d7_menu - source: menu_name + - + plugin: migration + migration: d7_menu + source: menu_name + - + plugin: skip_on_empty + method: row 'link/uri': plugin: d7_internal_uri source: diff --git a/core/modules/menu_link_content/src/Plugin/migrate/process/d7/InternalUri.php b/core/modules/menu_link_content/src/Plugin/migrate/process/d7/InternalUri.php index 66550cf..97f273a 100644 --- a/core/modules/menu_link_content/src/Plugin/migrate/process/d7/InternalUri.php +++ b/core/modules/menu_link_content/src/Plugin/migrate/process/d7/InternalUri.php @@ -21,7 +21,7 @@ class InternalUri extends ProcessPluginBase { public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { list($path) = $value; - if (parse_url($path, PHP_URL_SCHEME) === NULL) { + if (parse_url($path, PHP_URL_SCHEME) == NULL) { // If $path is the node page (i.e. node/[nid]) then return entity path. if (preg_match('/^node\/\d+$/', $path)) { // "entity: URI"s enable the menu link to appear in the Menu Settings diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php index 26508a4..0c915d4 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php @@ -88,7 +88,7 @@ public function testMenuLinks() { $menu_link_tree_service = \Drupal::service('menu.link_tree'); $parameters = new MenuTreeParameters(); $tree = $menu_link_tree_service->load(static::MENU_NAME, $parameters); - $this->assertEquals(2, count($tree)); + $this->assertCount(2, $tree); $children = 0; $google_found = FALSE; foreach ($tree as $menu_link_tree_element) {