Error while enabling the module

Created on 11 December 2018, almost 6 years ago
Updated 1 January 2024, 11 months ago

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)

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom londova

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada netgeek123

    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.

  • 🇬🇧United Kingdom Alina Basarabeanu

    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?

  • Status changed to Needs review about 1 year ago
  • 🇬🇧United Kingdom Alina Basarabeanu

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

  • 🇮🇹Italy afagioli Rome

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

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

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

  • 🇮🇹Italy afagioli Rome

    Facing this.
    Updating issue to latest supported release

  • Status changed to Needs work 11 months ago
  • 🇨🇳China lawxen

    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

  • Merge request !2Remove drupal9 support for module → (Merged) created by lawxen
  • Status changed to Needs review 11 months ago
  • Status changed to Fixed 11 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024