Problem/Motivation
Getting Type error when accessing Media browser link (/admin/content/browser).
TypeError: Drupal\Core\Cache\CacheableMetadata::setCacheTags(): Argument #1 ($cache_tags) must be of type array, null given, called in /var/www/html/docroot/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php on line 2377 in Drupal\Core\Cache\CacheableMetadata->setCacheTags() (line 29 of /var/www/html/docroot/core/lib/Drupal/Core/Cache/CacheableMetadata.php)
Steps to reproduce
Step1: Download and install the Media Directories module.
Step2: Getting type error when accessing Media browser link (/admin/content/browser).
TypeError: Drupal\Core\Cache\CacheableMetadata::setCacheTags(): Argument #1 ($cache_tags) must be of type array, null given, called in /var/www/html/docroot/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php on line 2377 in Drupal\Core\Cache\CacheableMetadata->setCacheTags() (line 29 of /var/www/html/docroot/core/lib/Drupal/Core/Cache/CacheableMetadata.php)
#0 /var/www/html/docroot/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2377): Drupal\Core\Cache\CacheableMetadata->setCacheTags(NULL)
#1 /var/www/html/docroot/core/modules/views/src/Plugin/views/cache/CachePluginBase.php(223): Drupal\views\Plugin\views\display\DisplayPluginBase->getCacheMetadata()
#2 /var/www/html/docroot/core/modules/views/src/Plugin/views/cache/CachePluginBase.php(143): Drupal\views\Plugin\views\cache\CachePluginBase->generateResultsKey()
#3 /var/www/html/docroot/core/modules/views/src/ViewExecutable.php(1424): Drupal\views\Plugin\views\cache\CachePluginBase->cacheGet('results')
#4 /var/www/html/docroot/core/modules/views/src/ViewExecutable.php(1459): Drupal\views\ViewExecutable->execute(NULL)
#5 /var/www/html/docroot/modules/contrib/entity_browser/src/Plugin/views/display/EntityBrowser.php(34): Drupal\views\ViewExecutable->render()
#6 /var/www/html/docroot/modules/contrib/entity_browser/src/Plugin/views/display/EntityBrowser.php(105): Drupal\entity_browser\Plugin\views\display\EntityBrowser->execute()
#7 /var/www/html/docroot/core/modules/views/src/ViewExecutable.php(1667): Drupal\entity_browser\Plugin\views\display\EntityBrowser->preview()
#8 /var/www/html/docroot/core/modules/views/src/Element/View.php(66): Drupal\views\ViewExecutable->preview('media_browser', Array)
#9 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
#10 /var/www/html/docroot/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#11 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#12 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#13 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, true)
#14 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(148): Drupal\Core\Render\Renderer->render(Array, true)
#15 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#16 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(149): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#17 /var/www/html/docroot/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php(36): Drupal\Core\Render\Renderer->renderRoot(Array)
#18 /var/www/html/docroot/core/lib/Drupal/Core/Ajax/HtmlCommand.php(30): Drupal\Core\Ajax\InsertCommand->getRenderedContent()
#19 /var/www/html/docroot/core/lib/Drupal/Core/Ajax/AjaxResponse.php(43): Drupal\Core\Ajax\HtmlCommand->render()
#20 /var/www/html/docroot/modules/contrib/media_directories/modules/media_directories_ui/src/Controller/MediaDirectoriesController.php(188): Drupal\Core\Ajax\AjaxResponse->addCommand(Object(Drupal\Core\Ajax\HtmlCommand))
#21 [internal function]: Drupal\media_directories_ui\Controller\MediaDirectoriesController->directoryContent(Object(Symfony\Component\HttpFoundation\Request))
#22 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#23 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#24 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#25 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#26 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#27 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#28 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/docroot/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /var/www/html/docroot/modules/custom/epri-core-components/epri_cohesion_customization/src/StackMiddleware/MyModule.php(45): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\epri_cohesion_customization\StackMiddleware\MyModule->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /var/www/html/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#37 {main}
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes