Problem/Motivation

After installation encountered error occur.

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/modules/contrib/gmail/src/Form/GmailConfigForm.php on line 82 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of core/lib/Drupal/Core/Form/ConfigFormBase.php).
Drupal\gmail\Form\GmailConfigForm->__construct() (Line: 89)
Drupal\gmail\Form\GmailConfigForm::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: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
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)

Steps to reproduce

1. Install and enable the Workflow module
2. Navigate module's configuration interface.
3. You will see unexpected error.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork gmail-3503513

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

kushagra.goyal created an issue. See original summary.

dineshkumarbollu’s picture

Assigned: Unassigned » dineshkumarbollu
dineshkumarbollu’s picture

Assigned: dineshkumarbollu » Unassigned

Hi @kushagra.goyal

I am unable to reproduce the can you provide detail steps for reproduce.
but the issue is due TypedConfigManagerInterface in latest versions of drupal

add

use Drupal\Core\Config\TypedConfigManagerInterface;

and inject service in contructor may fix the issue.see the similar issue for reference workflow

niharika.s’s picture

I got the error i have attached the screenshot and when i try to resolve the error by installing client library composer require google/apiclient:"^2.0" # Or latest compatible version then i got the error
The OAuth client was not found.
If you are a developer of this app, see error details.
Error 401: invalid_client

niharika.s’s picture

StatusFileSize
new13.23 KB

got error after installing client library

kushagra.goyal’s picture

Hi @dineshkumarbollu, I'm not sure why it's not replicating on your system. For me, I can see this error whether I install it via Composer or manually. However, after injecting this service, it's working.

@niharika.s, did you install it using Composer?

niharika.s’s picture

@kushagra.goyal i install via gitclone

kushagra.goyal’s picture

@niharika.s That's why the issue exists for you. The module requires Google dependencies, which are initially installed via Composer. This ensures everything works correctly. Installing apiclient later may still leave other dependencies missing. Try installing the module with Composer, and it should work as expected.

kushagra.goyal’s picture

MR is created for this particular issue.

alan_blake’s picture

Status: Active » Reviewed & tested by the community

Add information about #3 statement:

the issue is due TypedConfigManagerInterface in latest versions of drupal

Refer to "New parameter added to \Drupal\Core\Form\ConfigFormBase::__construct", this arguments is optional in drupal core v10.2 but will be required in v11.0.

I tested the module with drupal core v10.4.2, both with and without #9 's fix, this module works properly.

sundhar made their first commit to this issue’s fork.

sundhar’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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