diff --git a/core/modules/forum/forum.local_actions.yml b/core/modules/forum/forum.local_actions.yml new file mode 100644 index 0000000..9f571aa --- /dev/null +++ b/core/modules/forum/forum.local_actions.yml @@ -0,0 +1,11 @@ +forum_add_forum_local_action: + route_name: forum_add_forum + title: 'Add forum' + appears_on: + - forum_overview + +forum_add_container_local_action: + route_name: forum_add_container + title: 'Add container' + appears_on: + - forum_overview diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index c2879a5..e96ae1e 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -126,18 +126,6 @@ function forum_menu() { 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, ); - $items['admin/structure/forum/add/container'] = array( - 'title' => 'Add container', - 'tab_parent' => 'admin/structure/forum', - 'route_name' => 'forum_add_container', - 'type' => MENU_LOCAL_ACTION, - ); - $items['admin/structure/forum/add/forum'] = array( - 'tab_parent' => 'admin/structure/forum', - 'title' => 'Add forum', - 'route_name' => 'forum_add_forum', - 'type' => MENU_LOCAL_ACTION, - ); $items['admin/structure/forum/settings'] = array( 'title' => 'Settings', 'weight' => 100, @@ -210,18 +198,6 @@ function forum_menu_local_tasks(&$data, $router_item, $root_path) { } /** - * Implements hook_menu_local_tasks_alter(). - * - * Remove the 'Add Forum' and 'Add container' local tasks on the delete form. - */ -function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) { - if ($root_path == 'admin/structure/forum' && !empty($router_item['map'][3]) && - $router_item['map'][3] == 'delete') { - $data = array(); - } -} - -/** * Implements hook_entity_info(). */ function forum_entity_info(&$info) { diff --git a/core/modules/forum/lib/Drupal/forum/Form/Overview.php b/core/modules/forum/lib/Drupal/forum/Form/Overview.php index e3f9e07..b9a2c59 100644 --- a/core/modules/forum/lib/Drupal/forum/Form/Overview.php +++ b/core/modules/forum/lib/Drupal/forum/Form/Overview.php @@ -51,7 +51,7 @@ public function __construct(ConfigFactory $config_factory, EntityManager $entity public static function create(ContainerInterface $container) { return new static( $container->get('config.factory'), - $container->get('plugin.manager.entity'), + $container->get('entity.manager'), $container->get('module_handler'), $container->get('url_generator') );