summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstefanbutura2018-02-06 10:26:18 (GMT)
committertimKruijsen2018-02-06 10:26:18 (GMT)
commit22c79687fa9e8819cd859df1abbb453d17a1e09e (patch)
tree22cd3244e31ac886c330e17ea638021cf27a170b
parent88ef4d31128cc8b19d1868717f5be7c56677b983 (diff)
Issue #2937999 by stefan.butura: Integration with menu_link_attributes (does not preserve attributes)8.x-1.8
-rwxr-xr-xsrc/Controller/MenuLinksController.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Controller/MenuLinksController.php b/src/Controller/MenuLinksController.php
index b4ba173..61f9e67 100755
--- a/src/Controller/MenuLinksController.php
+++ b/src/Controller/MenuLinksController.php
@@ -72,6 +72,7 @@ class MenuLinksController extends ControllerBase {
'weight' => $menuLink->weight->getValue()[0]['value'],
'langcode' => $menuLink->langcode->getValue()[0]['value'],
'uuid' => $menuLink->uuid(),
+ 'attributes' => !empty($menuLink->link->getValue()[0]['options']['attributes']) ? $menuLink->link->getValue()[0]['options']['attributes'] : NULL,
];
if (array_key_exists('drush', $form) && $form['drush'] === TRUE) {
@@ -299,6 +300,7 @@ class MenuLinksController extends ControllerBase {
'link' => [
'uri' => $menuLink['uri'],
'title' => $menuLink['link_title'],
+ 'options' => !empty($menuLink['attributes']) ? ['attributes' => $menuLink['attributes']] : NULL,
],
'menu_name' => $menuLink['menu_name'],
'expanded' => $menuLink['expanded'] === '1' ? TRUE : FALSE,
@@ -385,6 +387,7 @@ class MenuLinksController extends ControllerBase {
'link' => [
'uri' => $menuLink['uri'],
'title' => $menuLink['link_title'],
+ 'options' => !empty($menuLink['attributes']) ? ['attributes' => $menuLink['attributes']] : NULL,
],
'menu_name' => $menuLink['menu_name'],
'expanded' => $menuLink['expanded'] === '1' ? TRUE : FALSE,
@@ -430,6 +433,7 @@ class MenuLinksController extends ControllerBase {
'link' => [
'uri' => $menuLink['uri'],
'title' => $menuLink['link_title'],
+ 'options' => !empty($menuLink['attributes']) ? ['attributes' => $menuLink['attributes']] : NULL,
],
'menu_name' => $menuLink['menu_name'],
'expanded' => $menuLink['expanded'] === '1' ? TRUE : FALSE,