ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(),

Created on 30 November 2024, 3 months ago

I installed the 4.1.1 release in a Drupal 11 site and tried to visit the settings.

ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/site_audit/src/Form/SiteAuditConfigForm.php on line 31 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 43 of /var/www/html/web/core/lib/Drupal/Core/Form/ConfigFormBase.php).

🐛 Bug report
Status

Active

Version

4.1

Component

Code

Created by

🇺🇸United States keiserjb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @keiserjb
  • 🇺🇸United States keiserjb

    Add TypedConfigManagerInterface to SiteAuditConfigForm constructor

    - Updated constructor to inject TypedConfigManagerInterface as required.
    - Fixed compatibility with ConfigFormBase parent class.
    - Updated `create()` method to include `config.typed` service.

  • 🇮🇳India priti197 Mumbai - India

    Created a patch to fix the issue.

  • 🇮🇳India arunsahijpal

    Hey @keiserjb,
    I have installed this module and there is no errors in the settings.
    Here is the ss for reference. Please add to steps to reproduce if it exists in your site.

  • 🇺🇸United States keiserjb

    Good to know, perhaps it was me. I shall try again.

  • 🇨🇦Canada noah

    I was getting this error after upgrading Drupal from 10.4.2 to 11.1.2. The patch at 4 works great to resolve the issue, but I had to make a few minor tweaks to get it to apply:

    1. The patch has an extra level of prefix in the file paths (they start with “/site_audit/”, so the patch has to be applied with -p2 rather than -p1 and can't be applied via Composer): I removed the extra level.
    2. The patch line endings are CRLF instead of LF (so I suspect it applies in Windows, but it doesn't elsewhere): I switched to LF.
    3. The patch file encoding shows up as UTF-16 Little Endian rather than UTF-8: I switched to UTF-8.

    So the code in the patch attached here is identical, only some meta stuff in the patch file is different.

Production build 0.71.5 2024