diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index d3df105..4707288 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -153,13 +153,12 @@ protected function getPluginDefinition() { if ($url_object) { if ($url_object->isExternal()) { $definition['url'] = $url_object->getUri(); - $definition['options'] = $url_object->getOptions(); } else { $definition['route_name'] = $url_object->getRouteName(); $definition['route_parameters'] = $url_object->getRouteParameters(); - $definition['options'] = $url_object->getOptions(); } + $definition['options'] = $url_object->getOptions(); } $definition['title'] = $this->getTitle(); @@ -287,6 +286,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['link'] = BaseFieldDefinition::create('link') ->setLabel(t('Link')) ->setDescription(t('The location this menu link points to.')) + ->setRequired(TRUE) ->setSettings(array( 'default_value' => '', 'max_length' => 560, diff --git a/core/modules/menu_link_content/src/Form/MenuLinkContentForm.php b/core/modules/menu_link_content/src/Form/MenuLinkContentForm.php index 0718473..f1d4a92 100644 --- a/core/modules/menu_link_content/src/Form/MenuLinkContentForm.php +++ b/core/modules/menu_link_content/src/Form/MenuLinkContentForm.php @@ -274,9 +274,6 @@ public function buildEntity(array $form, FormStateInterface $form_state) { $entity->enabled->value = (bool) $new_definition['enabled']; $entity->expanded->value = $new_definition['expanded']; - $entity->link->uri = $new_definition['url']; - $entity->link->options = $new_definition['options']; - return $entity; } diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index 1b49bf6..b46de31 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -162,7 +162,7 @@ function menu_ui_node_save(EntityInterface $node) { $entity = entity_create('menu_link_content', array( 'title' => trim($definition['title']), 'description' => trim($definition['description']), - // @todo Replace it with entity:// once possiblele + // @todo Replace it with entity: once possible. 'link' => ['uri' => 'node/' . $node->id()], 'menu_name' => $definition['menu_name'], 'parent' => $definition['parent'],