Not admin cannot access to media gallery

Created on 17 October 2025, 2 days ago

Problem/Motivation

Not admin user with partial permission, to edit only their own media galleries, are not able to use the media gallery module because they receive a system error.

Steps to reproduce

1. Set media gallery permissions for the content editor as attached in the screenshot

2. Log in or masquerade asa user without admin privileges

3. Open /admin/content/media_gallery

Proposed resolution

Fix the source code in the module

More information

#0 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/Entity/EntityListBuilder.php(132): Drupal\media_gallery\MediaGalleryListBuilder->getDefaultOperations()
#1 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/Entity/EntityListBuilder.php(248): Drupal\Core\Entity\EntityListBuilder->getOperations()
#2 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/Entity/EntityListBuilder.php(230): Drupal\Core\Entity\EntityListBuilder->buildOperations()
#3 /var/www/vhosts/drupal/web/modules/contrib/media_gallery/src/MediaGalleryListBuilder.php(91): Drupal\Core\Entity\EntityListBuilder->buildRow()
#4 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/Entity/EntityListBuilder.php(278): Drupal\media_gallery\MediaGalleryListBuilder->buildRow()
#5 /var/www/vhosts/drupal/web/modules/contrib/media_gallery/src/MediaGalleryListBuilder.php(52): Drupal\Core\Entity\EntityListBuilder->render()
#6 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/Entity/Controller/EntityListController.php(23): Drupal\media_gallery\MediaGalleryListBuilder->render()
#7 [internal function]: Drupal\Core\Entity\Controller\EntityListController->listing()
#8 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#9 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#11 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#12 /var/www/vhosts/drupal/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/vhosts/drupal/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#14 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#15 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#16 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#17 /var/www/vhosts/drupal/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#18 /var/www/vhosts/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#19 /var/www/vhosts/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#20 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#21 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#22 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#23 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#24 /var/www/vhosts/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#25 /var/www/vhosts/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#26 {main}
🐛 Bug report
Status

Active

Version

3.2

Component

Default

Created by

🇮🇹Italy acorda

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024