Skip to content
Snippets Groups Projects
Commit 22c79687 authored by Stefan Butura's avatar Stefan Butura Committed by Tim Kruijsen
Browse files

Issue #2937999 by stefan.butura: Integration with menu_link_attributes (does...

Issue #2937999 by stefan.butura: Integration with menu_link_attributes (does not preserve attributes)
parent 88ef4d31
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,7 @@ public function exportMenuLinks(array $form = NULL, FormStateInterface $form_sta
'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 @@ public static function importMenuLinksFull($menus, &$context) {
'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 @@ public static function importMenuLinksSafe($menus, &$context) {
'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 @@ public static function importMenuLinksForce($menus, &$context) {
'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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment