Fix Menu Position settings page throws ArgumentCountError on Drupal 11
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3517805. -->
Reported by: [lorseau](https://www.drupal.org/user/598330)
Related to !16
>>>
<p>Hello,</p>
<p>I just installed the module on a Drupal 11.1.6 version and here is the error message when I want to access to the "Settings" of the module (/admin/structure/menu-position/settings):</p>
<p><code>ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/docroot/modules/contrib/menu_position/src/Form/MenuPositionSettings.php on line 32 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of /var/www/html/docroot/core/lib/Drupal/Core/Form/ConfigFormBase.php).</code></p>
<pre>#0 /var/www/html/docroot/modules/contrib/menu_position/src/Form/MenuPositionSettings.php(32): Drupal\Core\Form\ConfigFormBase->__construct()<br>#1 /var/www/html/docroot/modules/contrib/menu_position/src/Form/MenuPositionSettings.php(40): Drupal\menu_position\Form\MenuPositionSettings->__construct()<br>#2 /var/www/html/docroot/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php(36): Drupal\menu_position\Form\MenuPositionSettings::create()<br>#3 /var/www/html/docroot/core/lib/Drupal/Core/Controller/HtmlFormController.php(48): Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition()<br>#4 /var/www/html/docroot/core/lib/Drupal/Core/Controller/FormController.php(58): Drupal\Core\Controller\HtmlFormController->getFormObject()<br>#5 [internal function]: Drupal\Core\Controller\FormController->getContentResult()<br>#6 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()<br>#7 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()<br>#8 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()<br>#9 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()<br>#10 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()<br>#11 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()<br>#12 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()<br>#13 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()<br>#14 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()<br>#15 /var/www/html/docroot/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()<br>#16 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()<br>#17 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()<br>#18 /var/www/html/docroot/modules/contrib/shield/src/ShieldMiddleware.php(263): Drupal\page_cache\StackMiddleware\PageCache->handle()<br>#19 /var/www/html/docroot/modules/contrib/shield/src/ShieldMiddleware.php(130): Drupal\shield\ShieldMiddleware->bypass()<br>#20 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\shield\ShieldMiddleware->handle()<br>#21 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()<br>#22 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()<br>#23 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()<br>#24 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()<br>#25 /var/www/html/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()<br>#26 {main}</pre>
issue