Support : Empty Avatar

Created on 10 September 2024, 3 months ago

Problem/Motivation

If the user image field(media) is empty, a log message is generated on every action or when you click on any unrelated link.
A loop occurs and thousands of the following dbLog messages are generated within minutes.

Tested with Drupal 10.3.3. & User Menu Avatar 9.0.0

Any idea, please ? Thanks

The messages created are as follows.

Warning: Trying to access array offset on null in Drupal\user_menu_avatar\Services\UserMenuAvatarServices->getMediaFieldImage() (line 182 of /var/www/html/d10site/web/modules/contrib/user_menu_avatar/src/Services/UserMenuAvatarServices.php)
Warning: Undefined array key 0 in Drupal\user_menu_avatar\Services\UserMenuAvatarServices->getMediaFieldImage() (line 182 of /var/www/html/d10site/web/modules/contrib/user_menu_avatar/src/Services/UserMenuAvatarServices.php)


#0 /var/www/html/d10site/web/core/includes/bootstrap.inc(166): _drupal_error_handler_real()
#1 /var/www/html/d10site/web/modules/contrib/user_menu_avatar/src/Services/UserMenuAvatarServices.php(182): _drupal_error_handler()
#2 /var/www/html/d10site/web/modules/contrib/user_menu_avatar/user_menu_avatar.module(112): Drupal\user_menu_avatar\Services\UserMenuAvatarServices->getMediaFieldImage()
#3 /var/www/html/d10site/web/modules/contrib/user_menu_avatar/user_menu_avatar.module(180): uma_image()
#4 /var/www/html/d10site/web/modules/contrib/user_menu_avatar/user_menu_avatar.module(238): uma_auth_markup()
#5 /var/www/html/d10site/web/modules/contrib/user_menu_avatar/user_menu_avatar.module(252): uma_apply_markup()
#6 /var/www/html/d10site/web/modules/contrib/user_menu_avatar/user_menu_avatar.module(252): uma_apply_markup()
#7 /var/www/html/d10site/web/modules/contrib/user_menu_avatar/user_menu_avatar.module(214): uma_apply_markup()
#8 [internal function]: user_menu_avatar_preprocess_menu()
#9 /var/www/html/d10site/web/core/lib/Drupal/Core/Theme/ThemeManager.php(261): call_user_func_array()
#10 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render()
#11 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#12 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#13 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#14 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#15 /var/www/html/d10site/web/core/modules/toolbar/toolbar.module(94): Drupal\Core\Render\Renderer->render()
#16 [internal function]: template_preprocess_toolbar()
#17 /var/www/html/d10site/web/core/lib/Drupal/Core/Theme/ThemeManager.php(261): call_user_func_array()
#18 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render()
#19 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#20 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#21 /var/www/html/d10site/web/core/lib/Drupal/Core/Template/TwigExtension.php(475): Drupal\Core\Render\Renderer->render()
#22 /var/www/html/d10site/vendor/twig/twig/src/Environment.php(392) : eval()'d code(83): Drupal\Core\Template\TwigExtension->escapeFilter()
#23 /var/www/html/d10site/vendor/twig/twig/src/Template.php(360): __TwigTemplate_91df9c3a6bb7217ddde9a056c97e4d6b->doDisplay()
#24 /var/www/html/d10site/vendor/twig/twig/src/Template.php(335): Twig\Template->yield()
#25 /var/www/html/d10site/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\Template->render()
#26 /var/www/html/d10site/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render()
#27 /var/www/html/d10site/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template()
#28 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render()
#29 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#30 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(158): Drupal\Core\Render\Renderer->render()
#31 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#32 /var/www/html/d10site/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(153): Drupal\Core\Render\Renderer->executeInRenderContext()
#33 /var/www/html/d10site/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#34 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#35 /var/www/html/d10site/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#36 /var/www/html/d10site/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#37 /var/www/html/d10site/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#38 /var/www/html/d10site/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#39 /var/www/html/d10site/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#40 /var/www/html/d10site/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#41 /var/www/html/d10site/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#42 /var/www/html/d10site/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#43 /var/www/html/d10site/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#44 /var/www/html/d10site/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#45 /var/www/html/d10site/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#46 /var/www/html/d10site/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#47 /var/www/html/d10site/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#48 /var/www/html/d10site/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#49 /var/www/html/d10site/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#50 {main}
💬 Support request
Status

Active

Version

9.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024