There is a deleted method getImplementations that return and error with drupal 10:

The website encountered an unexpected error. Please try again later.

Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::getImplementations() in bat_entity_access() (line 136 of modules/contrib/bat/bat.module).
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'bat') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_access', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_access', Array) (Line: 96)
Drupal\Core\Entity\EntityAccessControlHandler->access(Object, 'view', Object, ) (Line: 706)
Drupal\Core\Entity\ContentEntityBase->access('view label') (Line: 383)
Drupal\Core\Entity\Element\EntityAutocomplete::getEntityLabels(Array) (Line: 119)
Drupal\Core\Entity\Element\EntityAutocomplete::valueCallback(Array, , Object)
call_user_func_array(Array, Array) (Line: 1287)
Drupal\Core\Form\FormBuilder->handleInputElement('bat_event_availability_hourly_edit_form', Array, Object) (Line: 1005)
Drupal\Core\Form\FormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 154)
Drupal\autosave_form\Form\AutosaveFormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 154)
Drupal\autosave_form\Form\AutosaveFormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 154)
Drupal\autosave_form\Form\AutosaveFormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 154)
Drupal\autosave_form\Form\AutosaveFormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 1075)
Drupal\Core\Form\FormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 154)
Drupal\autosave_form\Form\AutosaveFormBuilder->doBuildForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 579)
Drupal\Core\Form\FormBuilder->processForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 144)
Drupal\autosave_form\Form\AutosaveFormBuilder->processForm('bat_event_availability_hourly_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 97)
Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
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: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 43)
Drupal\bat_api\StackMiddleware\BatApiMiddleware->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 45)
Drupal\services\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I don't know what is the policy for major versions, but this code is only supported since 9.4, although I haven't put this dependency for the moment.

I'm also not clear what the code does, I just changed the if the getImplementations for the hasImplementatiosn and the code that saved the logs a warning of the deprecated code, but that can no longer be used in Drupal 10.

CommentFileSizeAuthor
bat_getImplementations.patch1.5 KBcarlitus

Comments

Carlitus created an issue. See original summary.

jwwj’s picture

The patch worked on my installation. +1 for RTBC

afagioli’s picture

faced with next release..
needs work

afagioli’s picture

Status: Needs review » Needs work
afagioli’s picture

afagioli’s picture

Status: Needs work » Needs review
robindh’s picture

Status: Needs review » Needs work

I'm getting the error on the latest version of the module (8.x-10.1-beta3).

After some commit digging - it seems like this was originally fixed in https://git.drupalcode.org/project/bat/-/commit/213f90bbf51d3265800699f6... (8.x-10.1-beta2), but later accidentally reverted in https://git.drupalcode.org/project/bat/-/commit/af1067581774ea0182de72d7... (8.x-10.1-beta3)

afagioli’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.