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).

Issue fork site_audit-3490817

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

keiserjb created an issue. See original summary.

keiserjb’s picture

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.

keiserjb’s picture

priti197’s picture

Created a patch to fix the issue.

arunsahijpal’s picture

StatusFileSize
new157.26 KB

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.

keiserjb’s picture

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

noah’s picture

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.

kalash-j’s picture

Assigned: Unassigned » kalash-j

froboy’s picture

Assigned: kalash-j » Unassigned
Status: Active » Reviewed & tested by the community

I've tested the patch in git with composer patches against site_audit 4.1.1. It applies cleanly and resolves the issue.

I'm going to call this RTBC. I've opened the MR so it's easily mergable.

@kalash-j it does not look like you are a maintainer of the module, so you should not have assigned this issue to yourself. I've unassigned it.

  • froboy committed 1bb74623 on 4.x
    [#3490817] Add TypedConfigManagerInterface to SiteAuditConfigForm...
froboy’s picture

Thanks everyone. Tested and merged to 4.x. Releasing shortly.

froboy’s picture

Version: 4.1.1 » 4.1.2
Status: Reviewed & tested by the community » Fixed

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.