Problem/Motivation

Error when I access to ParagraphUsageManagerSettingsForm page.

Steps to reproduce

I enable module 1.0.0 on Drupal 11.3.8 and get error when I access to ParagraphUsageManagerSettingsForm page.

ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(),
1 passed in /var/www/html/web/modules/contrib/paragraphs_usage_manager/src/Form/ParagraphUsageMana
gerSettingsForm.php on line 24 and exactly 2 expected in
Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of
core/lib/Drupal/Core/Form/ConfigFormBase.php).
Drupal\paragraphs_usage_manager\Form\ParagraphUsageManagerSettingsForm->__construct() (Line: 31)
Drupal\paragraphs_usage_manager\Form\ParagraphUsageManagerSettingsForm::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->{closure:Drupal\Core\EventS
ubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}
() (Line: 634)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()
Fiber->start() (Line: 635)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRe
nderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventS
ubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (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: 53)
Asm89\Stack\Cors->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 745)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Proposed resolution

Drupal 11, `ConfigFormBase::__construct()` now requires 2 arguments:
`ConfigFactoryInterface` and `TypedConfigManagerInterface`. The contrib module
`paragraphs_usage_manager` only passes `$config_factory` to the parent constructor, missing the
second `$typedConfigManager` argument.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

havran created an issue. See original summary.

nono95230’s picture

Thanks a lot for the report and for providing a patch.

You are absolutely right about the root cause: the settings form extends ConfigFormBase but does not pass the typed config manager to the parent constructor, which breaks on Drupal 11.

Thank you as well for proposing a fix. I am going to test your patch locally and, if everything looks good, I will integrate it and include it in the next bugfix release.

nono95230’s picture

Assigned: Unassigned » nono95230
Status: Active » Needs review

Thanks again for the report and the patch.

I tested the proposed fix locally, applied the Drupal 11 compatibility fix, and also adjusted the composer constraints accordingly.

A merge request has been created.

Marking the issue as Needs review.

nono95230’s picture

Status: Needs review » Fixed

Thanks again for the report and the patch.

The issue has been fixed and included in the 1.0.1 release.

Closing the issue.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

nono95230’s picture

Status: Fixed » Closed (fixed)

Closing the issue.