summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorawolfey2018-02-08 10:31:30 (GMT)
committertimKruijsen2018-02-08 10:31:30 (GMT)
commit9c658938ee62bed24d74aa638841b46eb8a4d681 (patch)
treec5c0361251d1d3510863f398254604eebdf889fe
parent2ad0511fee40d119b67fa4c292f884a90ca9d04e (diff)
Issue #2943053 by awolfey: Patch for link attributes Full import8.x-1.9
-rwxr-xr-xsrc/Controller/MenuLinksController.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/Controller/MenuLinksController.php b/src/Controller/MenuLinksController.php
index 61f9e67..feb9a6c 100755
--- a/src/Controller/MenuLinksController.php
+++ b/src/Controller/MenuLinksController.php
@@ -223,13 +223,13 @@ class MenuLinksController extends ControllerBase {
}
if(!empty($uuidsInConfig)) {
- $query = StructureSyncHelper::getEntityQuery('menu_link_content');
- $query->condition('uuid', $uuidsInConfig, 'NOT IN');
- $ids = $query->execute();
- $controller = StructureSyncHelper::getEntityManager()
- ->getStorage('menu_link_content');
- $entities = $controller->loadMultiple($ids);
- $controller->delete($entities);
+ $query = StructureSyncHelper::getEntityQuery('menu_link_content');
+ $query->condition('uuid', $uuidsInConfig, 'NOT IN');
+ $ids = $query->execute();
+ $controller = StructureSyncHelper::getEntityManager()
+ ->getStorage('menu_link_content');
+ $entities = $controller->loadMultiple($ids);
+ $controller->delete($entities);
}
if (array_key_exists('drush', $context) && $context['drush'] === TRUE) {
@@ -251,12 +251,12 @@ class MenuLinksController extends ControllerBase {
}
$entities = [];
if(!empty($uuidsInConfig)) {
- $query = StructureSyncHelper::getEntityQuery('menu_link_content');
- $query->condition('uuid', $uuidsInConfig, 'IN');
- $ids = $query->execute();
- $controller = StructureSyncHelper::getEntityManager()
- ->getStorage('menu_link_content');
- $entities = $controller->loadMultiple($ids);
+ $query = StructureSyncHelper::getEntityQuery('menu_link_content');
+ $query->condition('uuid', $uuidsInConfig, 'IN');
+ $ids = $query->execute();
+ $controller = StructureSyncHelper::getEntityManager()
+ ->getStorage('menu_link_content');
+ $entities = $controller->loadMultiple($ids);
}
$parents = array_column($menus, 'parent');
@@ -322,6 +322,7 @@ class MenuLinksController extends ControllerBase {
->set('link', [
'uri' => $menuLink['uri'],
'title' => $menuLink['link_title'],
+ 'options' => !empty($menuLink['attributes']) ? ['attributes' => $menuLink['attributes']] : NULL,
])
->set('expanded', $menuLink['expanded'] === '1' ? TRUE : FALSE)
->set('enabled', $menuLink['enabled'] === '1' ? TRUE : FALSE)