Argument #1 ($event) must be of type object, string given, called in /var/www/html/web/modules/contrib/rest_api_access_token/src/Controller/AuthController.php

Created on 23 November 2023, about 1 year ago
Updated 1 May 2024, 8 months ago

Problem/Motivation

I have this error:

in drupal 10.1 EventDispatcher::dispatch() argument order changed.

The website encountered an unexpected error. Please try again later.<br><br><em class="placeholder">TypeError</em>:
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch(): Argument #1 ($event) must be of type object,
string given, called in /var/www/html/web/modules/contrib/rest_api_access_token/src/Controller/AuthController.php on
line 118 in <em class="placeholder">Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;dispatch()</em>
(line <em class="placeholder">89</em> of
<em class="placeholder">core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php</em>).
<pre class="backtrace">Drupal\rest_api_access_token\Controller\AuthController-&gt;tokenResponse(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

Steps to reproduce

Login with api/v1/auth/token

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇹Italy trickfun

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

Comments & Activities

Production build 0.71.5 2024