- Issue created by @d70rr3s
- Merge request !5Issue #3478970 by d70rr3s: Too few arguments error in CertificateLoginSettingsForm constructor → (Open) created by d70rr3s
When visiting the module configuration page it throws the following error
The website encountered an unexpected error. Try again later.
ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/certificatelogin/src/Form/CertificateLoginSettingsForm.php on line 45 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 43 of core/lib/Drupal/Core/Form/ConfigFormBase.php).
Drupal\certificatelogin\Form\CertificateLoginSettingsForm->__construct() (Line: 53)
Drupal\certificatelogin\Form\CertificateLoginSettingsForm::create() (Line: 36)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)
Using Drupal 10 or later
# your composer.json file
"repositories": [
{
"type": "vcs",
"url": "https://git.drupalcode.org/project/certificatelogin"
},
{
"type": "composer",
"url": "https://packages.drupal.org/8",
"only": [
"drupal/*"
]
}
],
and apply the patch 📌 Drupal 11 compatibility fixes for certificatelogin Active .
composer require 'drupal/certificatelogin:2.x-dev@dev'
./admin/config/people/certificatelogin
Since Drupal 10 ConfigFormBase requires the TypedConfigManager service to be passed as constructor argument. Just modify the CertificateLoginSettingsForm::create
and CertificateLoginSettingsForm::__construct
methods to inject the TypedConfigManager service (mind the type must be interface TypedConfigManagerInterface
not the implementation) and pass it to the parent's constructor.
N/A
N/A
N/A
Active
2.0
Code