diff --git a/core/modules/menu_link_content/menu_link_content.links.menu.yml b/core/modules/menu_link_content/menu_link_content.links.menu.yml index c221770..9f4fed2 100644 --- a/core/modules/menu_link_content/menu_link_content.links.menu.yml +++ b/core/modules/menu_link_content/menu_link_content.links.menu.yml @@ -1,4 +1,4 @@ menu_link_content: class: \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent form_class: \Drupal\menu_link_content\Form\MenuLinkContentForm - deriver: \Drupal\menu_link_content\Plugin\Deriver\UserPathMenuLinkContentDeriver + deriver: \Drupal\menu_link_content\Plugin\Deriver\MenuLinkContentDeriver diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index 43d0092..3ae1f44 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -189,6 +189,9 @@ public function preSave(EntityStorageInterface $storage) { if (parse_url($this->link->uri, PHP_URL_SCHEME) === 'user-path') { $this->setRequiresRediscovery(TRUE); } + else { + $this->setRequiresRediscovery(FALSE); + } } /** * {@inheritdoc} diff --git a/core/modules/menu_link_content/src/MenuLinkContentInterface.php b/core/modules/menu_link_content/src/MenuLinkContentInterface.php index bc4cc9a..d2b8254 100644 --- a/core/modules/menu_link_content/src/MenuLinkContentInterface.php +++ b/core/modules/menu_link_content/src/MenuLinkContentInterface.php @@ -110,8 +110,8 @@ public function getPluginDefinition(); * a given path might change over time. * * For example: at the time a menu-link is created, the /blog path might be - * provided by a route in views module, but later this path may be served by - * the panels module. Flagging a link as requiring rediscovery ensures that if + * provided by a route in Views module, but later this path may be served by + * the Panels module. Flagging a link as requiring rediscovery ensures that if * the route that provides a user-entered path changes over time, the link is * flexible enough to update to reflect these changes. * diff --git a/core/modules/menu_link_content/src/Plugin/Deriver/UserPathMenuLinkContentDeriver.php b/core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php similarity index 91% rename from core/modules/menu_link_content/src/Plugin/Deriver/UserPathMenuLinkContentDeriver.php rename to core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php index 12e4855..76c2d33 100644 --- a/core/modules/menu_link_content/src/Plugin/Deriver/UserPathMenuLinkContentDeriver.php +++ b/core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\menu_link_content\Plugin\Deriver\UserPathMenuLinkContentDeriver. + * Contains \Drupal\menu_link_content\Plugin\Deriver\MenuLinkContentDeriver. */ namespace Drupal\menu_link_content\Plugin\Deriver; @@ -20,7 +20,7 @@ * The assumption is that the number of manually entered menu links are lower * compared to entity referenced ones. */ -class UserPathMenuLinkContentDeriver extends DeriverBase implements ContainerDeriverInterface { +class MenuLinkContentDeriver extends DeriverBase implements ContainerDeriverInterface { /** * The query factory. @@ -44,7 +44,7 @@ class UserPathMenuLinkContentDeriver extends DeriverBase implements ContainerDer protected $menuLinkManager; /** - * Constructs a UserPathMenuLinkContentDeriver instance. + * Constructs a MenuLinkContentDeriver instance. * * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory * The query factory. diff --git a/core/modules/menu_link_content/src/Tests/UserPathMenuLinkContentDeriverTest.php b/core/modules/menu_link_content/src/Tests/MenuLinkContentDeriverTest.php similarity index 93% rename from core/modules/menu_link_content/src/Tests/UserPathMenuLinkContentDeriverTest.php rename to core/modules/menu_link_content/src/Tests/MenuLinkContentDeriverTest.php index ff4ba26..d18a092 100644 --- a/core/modules/menu_link_content/src/Tests/UserPathMenuLinkContentDeriverTest.php +++ b/core/modules/menu_link_content/src/Tests/MenuLinkContentDeriverTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\menu_link_content\Tests\UserPathMenuLinkContentDeriverTest. + * Contains \Drupal\menu_link_content\Tests\MenuLinkContentDeriverTest. */ namespace Drupal\menu_link_content\Tests; @@ -17,7 +17,7 @@ * * @group menu_link_content */ -class UserPathMenuLinkContentDeriverTest extends KernelTestBase { +class MenuLinkContentDeriverTest extends KernelTestBase { /** * {@inheritdoc}