The following error appear when enabling the module from Admin interface:
-----------------------------------------------------------------------------------
The website encountered an unexpected error. Please try again later.
Error: Call to a member function getContextDefinitions() on boolean in Drupal\services\Routing\ServiceEndpoint->routes() (line 27 of modules/services/src/Routing/ServiceEndpoint.php).
Drupal\services\Routing\ServiceEndpoint->routes()
call_user_func(Array) (Line: 146)
Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)
Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 322)
Drupal\Core\Extension\ModuleInstaller->install(Array, 1) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array) (Line: 458)
Drupal\system\Form\ModulesListForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder->buildForm('system_modules', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 44)
Drupal\services\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 669)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

CommentFileSizeAuthor
#9 bat_api-3019531-9.patch844 bytesalina.basarabeanu

Issue fork bat_api-3019531

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

Londova created an issue. See original summary.

Anonymous’s picture

I'm getting similar & if I clear cache it breaks the site :(

Error: Call to a member function getDefinitions() on null in Drupal\services\Plugin\Deriver\EntityPost->getDerivativeDefinitions() (line 16 of /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/modules/contrib/services/src/Plugin/Deriver/EntityPost.php) #0 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\services\Plugin\Deriver\EntityPost->getDerivativeDefinitions(Array) #1 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array) #2 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(284): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() #3 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() #4 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() #5 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php(59): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('calendar_events...', false) #6 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/modules/contrib/services/src/Entity/ServiceResource.php(169): Drupal\Core\Plugin\DefaultPluginManager->hasDefinition('calendar_events...') #7 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/modules/contrib/services/src/Entity/ServiceResource.php(151): Drupal\services\Entity\ServiceResource->hasServicePlugin() #8 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/modules/contrib/services/src/Routing/ServiceEndpoint.php(23): Drupal\services\Entity\ServiceResource->createServicePluginInstance() #9 [internal function]: Drupal\services\Routing\ServiceEndpoint->routes() #10 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func(Array) #11 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild() #12 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/includes/common.inc(1160): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() #13 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/modules/contrib/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php(166): drupal_flush_all_caches() #14 [internal function]: Drupal\admin_toolbar_tools\Controller\ToolbarController->flushAll() #15 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #16 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #18 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #19 /Users/stephenpurkiss/Sites/myawesomedrupalsite/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #20 /Users/stephenpurkiss/Sites/myawesomedrupalsite/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #21 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/modules/contrib/bat_api/src/StackMiddleware/BatApiMiddleware.php(44): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\bat_api\StackMiddleware\BatApiMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/modules/contrib/services/src/StackMiddleware/FormatSetter.php(44): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\services\StackMiddleware\FormatSetter->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /Users/stephenpurkiss/Sites/myawesomedrupalsite/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /Users/stephenpurkiss/Sites/myawesomedrupalsite/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #32 {main}.

Anonymous’s picture

...although mine is enabled and I'm using it so perhaps I should go create a new issue whilst I continue to investigate.

londova’s picture

I updated to the latest version.
now I got a different error:
----
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "bat_fullcalendar.fixed_state_event_formatter". in Drupal\Component\DependencyInjection\Container->get() (line 153 of /...mysite.../core/lib/Drupal/Component/DependencyInjection/Container.php).
----

afagioli’s picture

following...

afagioli’s picture

similar issue while installing the "jsonapi" core module on a "Drupal 8 Bat" instance.

See

Drupal\bat_api\StackMiddleware\BatApiMiddleware->handle(Object, 1, 1) (Line: 57)

inside:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 2 passed to Drupal\jsonapi\Routing\Routes::Drupal\jsonapi\Routing\{closure}() must be an instance of Drupal\jsonapi\ResourceType\ResourceType, null given in Drupal\jsonapi\Routing\Routes::Drupal\jsonapi\Routing\{closure}() (line 434 of core/modules/jsonapi/src/Routing/Routes.php).
Drupal\jsonapi\Routing\Routes::Drupal\jsonapi\Routing\{closure}(, NULL)
array_reduce(Array, Object, ) (Line: 436)
Drupal\jsonapi\Routing\Routes::hasNonInternalTargetResourceTypes(Array) (Line: 339)
Drupal\jsonapi\Routing\Routes::getIndividualRoutesForResourceType(Object) (Line: 183)
Drupal\jsonapi\Routing\Routes::getRoutesForResourceType(Object, '/jsonapi') (Line: 116)
Drupal\jsonapi\Routing\Routes->routes()
call_user_func(Array) (Line: 146)
Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)
Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 344)
Drupal\Core\Extension\ModuleInstaller->install(Array, 1) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array) (Line: 458)
Drupal\system\Form\ModulesListForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 54)
Drupal\bat_api\StackMiddleware\BatApiMiddleware->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 44)
Drupal\services\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
netgeek123’s picture

using drush en bat_api

drush en bat_api
The following module(s) will be enabled: bat_api, bat_event

 Do you want to continue? (yes/no) [yes]:
 > yes

  
In Container.php line 157:
                                                                               
  You have requested a non-existent service "bat_fullcalendar.fixed_state_eve  
  nt_formatter". 

Full calendar is installed.

EDIT
bat_fullcalendar was not enabled. Perhaps the dependacy is skipped when trying to enable bat_api?

alina.basarabeanu’s picture

Using bat_api 1.3.0, with 2 patches for issue 3348451 & 3286204 on D10 we get a fatal error:
Fatal error: Declaration of Drupal\bat_api\StackMiddleware\BatApiMiddleware::handle(Symfony\Component\HttpFoundation\Request $request, $type = self::MASTER_REQUEST, $catch = true) must be compatible with Symfony\Component\HttpKernel\HttpKernelInterface::handle(Symfony\Component\HttpFoundation\Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Symfony\Component\HttpFoundation\Response in /var/www/html/docroot/modules/contrib/bat_api/src/StackMiddleware/BatApiMiddleware.php on line 37

This module is not up to date and very difficult to keep it up to the latest changes to Drupal.
Can someone have a look at all the patches and create a new D10 stable version?

alina.basarabeanu’s picture

Status: Active » Needs review
StatusFileSize
new844 bytes

A patch was created to fix the error.
The constant MASTER_REQUEST is deprecated and it was replaced with MAIN_REQUEST in BatApiMiddleware class.

afagioli’s picture

afagioli’s picture

Patch at #9 is promising.

causing

PHP Fatal error:  Declaration of Drupal\bat_api\StackMiddleware\BatApiMiddleware::handle(Symfony\Component\HttpFoundation\Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Symfony\Component\HttpFoundation\Response must be compatible with Symfony\Component\HttpKernel\HttpKernelInterface::handle(Symfony\Component\HttpFoundation\Request $request, $type = self::MASTER_REQUEST, $catch = true) in /var/www/html/d9batapi/web/modules/contrib/bat_api/src/StackMiddleware/BatApiMiddleware.php on line 38

Fatal error: Declaration of Drupal\bat_api\StackMiddleware\BatApiMiddleware::handle(Symfony\Component\HttpFoundation\Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Symfony\Component\HttpFoundation\Response must be compatible with Symfony\Component\HttpKernel\HttpKernelInterface::handle(Symfony\Component\HttpFoundation\Request $request, $type = self::MASTER_REQUEST, $catch = true) in /var/www/html/d9batapi/web/modules/contrib/bat_api/src/StackMiddleware/BatApiMiddleware.php on line 38

on drush en bat_api though.

Worth to be discussed in the new issue (seems to be out of scope here)

meryem dibe’s picture

Hello Patch #9 worked for me on D10.
Thanks @Alina Basarabeanu.
indeed as you mentioned, A stable version is needed

afagioli’s picture

Facing this.
Updating issue to latest supported release

afagioli’s picture

Version: 8.x-1.0-beta2 » 3.0.x-dev

afagioli’s picture

Find this fix with https://www.drupal.org/project/bat_api/releases/3.1.0-alpha2
Thanks for contribuiting

lawxen’s picture

Status: Needs review » Needs work

3.1.0-alpha2 didn't work on drupal9.5 when running drush updb

  Fatal error: Declaration of Drupal\bat_api\StackMiddleware\BatApiMiddleware::handle(Symfony\Component\HttpFoundation\Request $request, int $type = self::MAIN_REQUEST, bool $c
  atch = true): Symfony\Component\HttpFoundation\Response must be compatible with Symfony\Component\HttpKernel\HttpKernelInterface::handle(Symfony\Component\HttpFoundation\Requ
  est $request, $type = self::MASTER_REQUEST, $catch = true) in /var/www/html/docroot/modules/contrib/bat_api/src/StackMiddleware/BatApiMiddleware.php on line 34

We need remove d9 compatibility on info.yml

lawxen’s picture

Status: Needs work » Needs review
afagioli’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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