social_media_links' broken block plugin causes fatal error: unexpected error has occurred while fetching components
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3578295. --> Reported by: [wes.congruityworks.com](https://www.drupal.org/user/3772948) >>> <h3 id="overview">Overview</h3> <p>Installing and enabling the Social Media Links Block and Field (<a href="https://www.drupal.org/project/social_media_links">https://www.drupal.org/project/social_media_links</a>) causes the following error:</p> <pre>An unexpected error has occurred while fetching components.<br><br>Error 500: Drupal\social_media_links\SocialMediaLinksPlatformManager::getPlatformsWithValue(): Argument #1 ($platforms) must be of type array, null given, called in /app/web/modules/contrib/social_media_links/src/Plugin/Block/SocialMediaLinksBlock.php on line 358</pre><h3 id="reproduce">Reproducing the error</h3> <ol> <li>A fresh Drupal 11 project with Canvas installed</li> <li>Install and enable Social Media Links Block and Field</li> <li>Create or edit a Canvas page</li> <li>In the top left, press the "+" (Library) button</li> <li>The Library menu slides open and displays the Components and Patterns tab</li> <li>Within the Components tab, the error message is displayed (the same error shows up in the logs)</li> </ol> <h3 id="stack-trace">dblog stack trace</h3> <pre>#0 /app/web/modules/contrib/social_media_links/src/Plugin/Block/SocialMediaLinksBlock.php(358): Drupal\social_media_links\SocialMediaLinksPlatformManager-&gt;getPlatformsWithValue(NULL)<br>#1 /app/web/modules/contrib/canvas/src/Plugin/Canvas/ComponentSource/BlockComponent.php(245): Drupal\social_media_links\Plugin\Block\SocialMediaLinksBlock-&gt;build()<br>#2 /app/web/modules/contrib/canvas/src/Plugin/Canvas/ComponentSource/BlockComponent.php(413): Drupal\canvas\Plugin\Canvas\ComponentSource\BlockComponent-&gt;renderComponent(Array, Array, 'd6ab8d45-6497-4...', true)<br>#3 /app/web/modules/contrib/canvas/src/Entity/Component.php(301): Drupal\canvas\Plugin\Canvas\ComponentSource\BlockComponent-&gt;getClientSideInfo(Object(Drupal\canvas\Entity\Component))<br>#4 /app/web/modules/contrib/canvas/src/Controller/ApiConfigControllers.php(385): Drupal\canvas\Entity\Component-&gt;normalizeForClientSide()<br>#5 /app/web/core/lib/Drupal/Core/Render/Renderer.php(634): Drupal\canvas\Controller\ApiConfigControllers-&gt;Drupal\canvas\Controller\{closure}()<br>#6 [internal function]: Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()<br>#7 /app/web/core/lib/Drupal/Core/Render/Renderer.php(635): Fiber-&gt;start()<br>#8 /app/web/modules/contrib/canvas/src/Controller/ApiConfigControllers.php(383): Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))<br>#9 /app/web/modules/contrib/canvas/src/Controller/ApiConfigControllers.php(395): Drupal\canvas\Controller\ApiConfigControllers-&gt;Drupal\canvas\Controller\{closure}(Object(Drupal\canvas\Entity\Component))<br>#10 /app/web/modules/contrib/canvas/src/Controller/ApiConfigControllers.php(118): Drupal\canvas\Controller\ApiConfigControllers-&gt;normalize(Object(Drupal\canvas\Entity\Component))<br>#11 [internal function]: Drupal\canvas\Controller\ApiConfigControllers-&gt;list('component')<br>#12 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)<br>#13 /app/web/core/lib/Drupal/Core/Render/Renderer.php(634): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()<br>#14 [internal function]: Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()<br>#15 /app/web/core/lib/Drupal/Core/Render/Renderer.php(635): Fiber-&gt;start()<br>#16 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))<br>#17 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array)<br>#18 /app/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()<br>#19 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)<br>#20 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#21 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#22 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#23 /app/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#24 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(118): Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#25 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(92): Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#26 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#27 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#28 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#29 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(54): Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#30 /app/web/core/lib/Drupal/Core/DrupalKernel.php(745): Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)<br>#31 /app/web/index.php(19): Drupal\Core\DrupalKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request))<br>#32 {main}</pre> > Related issue: [Issue #3023172](https://www.drupal.org/node/3023172)
issue