One too many "Media" tabs at /admin/content

Created on 5 October 2019, over 5 years ago
Updated 24 August 2023, almost 2 years ago

Problem/Motivation

There are two "Media" tabs on the /admin/content page:

  • one for the Media Library view
  • one for the Media view

There's also some conflict between them since they use the same path "/admin/content/media". If you click on the Media Library tab, the other Media tab gets highlighted.

Proposed resolution

I'm not sure what's the expected behavior, so I'm not sure yet. Perhaps the Media view should be disabled when Media Library is installed?

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

9.5

Component
Media 

Last updated about 18 hours ago

Created by

🇺🇸United States oknate Greater New York City Area

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇲🇼Malawi chancenyasulu

    I have tried to use hook menu_local_tasks_alter to unset one, unset worked but problem now ma facing is that when I visit the tab the tab is not marked as active

       /**
     * Implements hook_menu_local_tasks_alter().
     */
    function mymodue_menu_local_tasks_alter(&$data, $route_name, $route_match) {
    
      //tabs route names on page.
      $tabs = [
        'content_page'=>[
          'system.admin_content',
          'comment.admin',
          'entity.media.collection',
        ]
      ];
    
      if (in_array($route_name, $tabs['content_page'])) {
        // Remove the "Media and Comments" tab.
        unset($data['tabs'][0]['entity.media.collection']);
        unset($data['tabs'][0]['comment.admin']);
      }
      
    }
    

    when I dump($data); tabs list shows that the keys i have unset are not available anymore yet the tab single tab is still showing

  • 🇺🇸United States rraney

    I'm having this issue. The duplicate Media items keep coming back. I can temporarily fix by clearing cache. I changed the Media Library view name from "Media" to "Media Library". If it happens again, I am guessing this view might be added to the content menu as "Media Library".

  • 🇮🇳India SourabhBhalerao

    We are also facing the same issue.

    After clear cache it is resolving temporary and again keep coming back

Production build 0.71.5 2024