Fix "Too few arguments to function SitemapSyndicateBlock::__construct()" error

Created on 5 April 2022, about 2 years ago
Updated 2 March 2024, 4 months ago

Problem/Motivation

Finding this in our logs

ArgumentCountError: Too few arguments to function Drupal\sitemap\Plugin\Block\SitemapSyndicateBlock::__construct(), 3 passed in /var/www/webroot/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php on line 25 and exactly 6 expected in Drupal\sitemap\Plugin\Block\SitemapSyndicateBlock->__construct() (line 64 of /var/www/webroot/modules/contrib/sitemap/src/Plugin/Block/SitemapSyndicateBlock.php)
#0 /var/www/webroot/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(25): Drupal\sitemap\Plugin\Block\SitemapSyndicateBlock->__construct()
#1 /var/www/webroot/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(76): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance()
#2 /var/www/webroot/core/modules/layout_builder/src/SectionComponent.php(243): Drupal\Component\Plugin\PluginManagerBase->createInstance()
#3 /var/www/webroot/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php(165): Drupal\layout_builder\SectionComponent->getPlugin()
#4 /var/www/webroot/core/modules/layout_builder/src/Form/AddBlockForm.php(61): Drupal\layout_builder\Form\ConfigureBlockFormBase->doBuildForm()
#5 [internal function]: Drupal\layout_builder\Form\AddBlockForm->buildForm()
#6 /var/www/webroot/core/lib/Drupal/Core/Form/FormBuilder.php(531): call_user_func_array()
#7 /var/www/webroot/core/lib/Drupal/Core/Form/FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm()
#8 /var/www/webroot/modules/contrib/autosave_form/src/Form/AutosaveFormBuilder.php(97): Drupal\Core\Form\FormBuilder->buildForm()
#9 /var/www/webroot/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm()
#10 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#11 /var/www/webroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#12 /var/www/webroot/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/webroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#14 /var/www/webroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#15 /var/www/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /var/www/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#17 /var/www/webroot/modules/contrib/force_password_change/src/Service/ForcePasswordChangeRedirectMiddleware.php(42): Symfony\Component\HttpKernel\HttpKernel->handle()
#18 /var/www/webroot/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\force_password_change\Service\ForcePasswordChangeRedirectMiddleware->handle()
#19 /var/www/webroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#20 /var/www/webroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#21 /var/www/webroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#22 /var/www/webroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#23 /var/www/webroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#24 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#25 /var/www/webroot/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle()
#26 /var/www/webroot/index.php(19): Drupal\Core\DrupalKernel->handle()
#27 {main}

πŸ› Bug report
Status

Postponed: needs info

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States smustgrave

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • πŸ‡¨πŸ‡¦Canada mparker17 UTC-4

    @smustgrave and @podarok, are you still experiencing this issue on the latest version of the Sitemap module?

    If so, please set the "Status" to "Active" and the "Version" to "8.x-2.x-dev".

    (I'm cleaning up old issues as part of a big review of open issues for 🌱 [Plan] Stable 8.x-2.0 release Active : thank you for your patience with me)

Production build 0.69.0 2024