diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php b/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php index 392c3d8..57a2688 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php @@ -110,10 +110,13 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) * {@inheritdoc} */ public function preSave(EntityStorageControllerInterface $storage_controller) { + $links = array(); // Just store the UUIDs. foreach ($this->links as $uuid => $link) { - $this->links[$uuid] = $uuid; + //$this->links[$uuid] = $uuid; + $links[] = $uuid; } + $this->links = $links; } /** diff --git a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php index 2f17850..5b9a6a8 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php @@ -22,6 +22,10 @@ protected function attachLoad(&$queried_entities, $revision_id = FALSE) { parent::attachLoad($queried_entities, $revision_id); foreach ($queried_entities as $id => $entity) { + // Flip links array, as UUIDs saved as free indexed array. + if (isset($entity->links)) { + $entity->links = array_flip($entity->links); + } $links = menu_load_links('shortcut-' . $id); foreach ($links as $menu_link) { $entity->links[$menu_link->uuid()] = $menu_link;