Commit b3e58a64 authored by webchick's avatar webchick

Issue #2312389 by er.pushpinderrana, Berdir, fago: Remove menu_link_content_uninstall()

parent 07775088
<?php
/**
* @file
* Install, update and uninstall functions for the menu_link_content module.
*/
/**
* Implements hook_uninstall().
*/
function menu_link_content_uninstall() {
// Find all the entities and then call the manager and delete all the plugins.
$query = \Drupal::entityQueryAggregate('menu_link_content');
$query->groupBy('uuid');
$result = $query->execute();
$uuids = array();
foreach ($result as $row) {
$uuids[] = $row['uuid'];
}
/** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
$menu_link_manager = \Drupal::service('plugin.manager.menu.link');
foreach ($uuids as $uuid) {
// Manually build the plugin ID, and remove it from the menu tree.
$menu_link_manager->removeDefinition("menu_link_content:$uuid", FALSE);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment