From abd52e2e4da8f8c2a1d5ab0f56bdd045ffa082ea Mon Sep 17 00:00:00 2001 From: webchick Date: Sat, 31 Jan 2015 12:26:27 -0800 Subject: [PATCH] Issue #2417877 by pwolanin: Make getDefinition method on menu link content entity public so we can rebuild user paths --- .../menu_link_content/src/Entity/MenuLinkContent.php | 11 +++-------- .../src/MenuLinkContentInterface.php | 10 ++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index f6c62a602ef..a12f373961e 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -136,20 +136,15 @@ class MenuLinkContent extends ContentEntityBase implements MenuLinkContentInterf } /** - * Builds up the menu link plugin definition for this entity. - * - * @return array - * The plugin definition corresponding to this entity. - * - * @see \Drupal\Core\Menu\MenuLinkTree::$defaults + * {@inheritdoc} */ - protected function getPluginDefinition() { + public function getPluginDefinition() { $definition = array(); $definition['class'] = 'Drupal\menu_link_content\Plugin\Menu\MenuLinkContent'; $definition['menu_name'] = $this->getMenuName(); if ($url_object = $this->getUrlObject()) { - if ($url_object->isExternal()) { + if (!$url_object->isRouted()) { $definition['url'] = $url_object->getUri(); } else { diff --git a/core/modules/menu_link_content/src/MenuLinkContentInterface.php b/core/modules/menu_link_content/src/MenuLinkContentInterface.php index 3f385e4537f..650b3d297da 100644 --- a/core/modules/menu_link_content/src/MenuLinkContentInterface.php +++ b/core/modules/menu_link_content/src/MenuLinkContentInterface.php @@ -92,4 +92,14 @@ interface MenuLinkContentInterface extends ContentEntityInterface, EntityChanged */ public function getWeight(); + /** + * Builds up the menu link plugin definition for this entity. + * + * @return array + * The plugin definition corresponding to this entity. + * + * @see \Drupal\Core\Menu\MenuLinkTree::$defaults + */ + public function getPluginDefinition(); + }