Incompatible with JSON:API Extras

Created on 25 July 2019, almost 5 years ago
Updated 8 May 2023, about 1 year ago

Getting this when enabling and on just about every page request.

Using core 8.7.5, JSON:API Extras 3.8

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Drupal\jsonapi_cross_bundles\ResourceType\CrossBundleResourceTypeRepository' does not have a method 'setConfigFactory' in Drupal\Component\DependencyInjection\Container->createService() (line 329 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Once that is resolved, two more follow:

 [warning] call_user_func_array() expects parameter 1 to be a valid callback, class 'Drupal\jsonapi_cross_bundles\ResourceType\CrossBundleResourceTypeRepository' does not have a method 'setEnhancerManager' Container.php:329
[warning] call_user_func_array() expects parameter 1 to be a valid callback, class 'Drupal\jsonapi_cross_bundles\ResourceType\CrossBundleResourceTypeRepository' does not have a method 'setEntityRepository' Container.php:329

Also, when viewing the JSON:API extras resources page at admin/config/services/jsonapi/resource_types:

TypeError: Argument 3 passed to Drupal\jsonapi_extras\JsonapiResourceConfigListBuilder::__construct() must be an instance of Drupal\jsonapi_extras\ResourceType\ConfigurableResourceTypeRepository, instance of Drupal\jsonapi_cross_bundles\ResourceType\CrossBundleResourceTypeRepository given, called in /var/www/docroot/modules/contrib/jsonapi_extras/src/JsonapiResourceConfigListBuilder.php on line 59 in Drupal\jsonapi_extras\JsonapiResourceConfigListBuilder->__construct() (line 45 of modules/contrib/jsonapi_extras/src/JsonapiResourceConfigListBuilder.php).
Drupal\jsonapi_extras\JsonapiResourceConfigListBuilder->__construct(Object, Object, Object, Object) (Line: 59)
Drupal\jsonapi_extras\JsonapiResourceConfigListBuilder::createInstance(Object, Object) (Line: 288)
Drupal\Core\Entity\EntityTypeManager->createHandlerInstance('Drupal\jsonapi_extras\JsonapiResourceConfigListBuilder', Object) (Line: 277)
Drupal\Core\Entity\EntityTypeManager->getHandler('jsonapi_resource_config', 'list_builder') (Line: 215)
Drupal\Core\Entity\EntityTypeManager->getListBuilder('jsonapi_resource_config') (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('jsonapi_resource_config')
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->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: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States mstef

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

Comments & Activities

Not all content is available!

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

  • 🇮🇹Italy Giuseppe87

    I've tried the patch and I don't have neither the issue described in #16 or #23.
    If I go to /admin/config/services/jsonapi/resource_types I get no error; the bundles created by cross bundles are listed but not overridable.

    However I think the compatibility is only partial: both this module and extra extends ResourceType, so the extra functionality provided by extras are not available to the end-points created by cross bundles.
    For example, the "count" is not possible right now, because CrossBundlesResourceType inherits the parent one:

      public function includeCount() {
        // By default, do not return counts in collection queries.
        return FALSE;
      }
Production build 0.69.0 2024