Skip to content
Snippets Groups Projects
Commit 74de8ece authored by Julian Pustkuchen's avatar Julian Pustkuchen Committed by João Ventura
Browse files

Issue #3447050 by Grevil, Anybody, jcnventura: Need to deep merge options for...

Issue #3447050 by Grevil, Anybody, jcnventura: Need to deep merge options for compatibility with other modules
parent 6d4fbd13
Branches
Tags
1 merge request!14Merge array recursive
......@@ -9,6 +9,7 @@ use Drupal\Component\Utility\Unicode;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\menu_link_content\MenuLinkContentInterface;
use Drupal\Component\Utility\NestedArray;
/**
* Implements hook_form_BASE_FORM_ID_alter().
......@@ -187,8 +188,9 @@ function menu_link_attributes_menu_link_content_form_entity_builder($entity_type
$menu_link_options = $original->get('link')->first()->options;
}
// Merge with existing options:
$existing_options = $menu_link->link->first()->options;
$menu_link->link->first()->options = array_merge($existing_options, $menu_link_options);
$menu_link->link->first()->options = NestedArray::mergeDeep($existing_options, $menu_link_options);
// Set for other languages.
if ($menu_link->isDefaultTranslation() || !$menu_link->isDefaultTranslationAffectedOnly()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment