Skip to content

Drupal's JSON:API EntityResource requires EventDispatcher as dependency #877

@laurielim

Description

@laurielim

Package containing the bug

I’m not sure

Describe the bug

I have a Drupal commerce site with next on the frontend and I get the following error when posting to the add to cart endpoint as the next_jsonapi overrides Drupal's EntityResource.

TypeError: Cannot assign int to property Drupal\jsonapi\Controller\EntityResource::$eventDispatcher of type Symfony\Component\EventDispatcher\EventDispatcherInterface in Drupal\jsonapi\Controller\EntityResource->__construct()

Expected behavior

jsonapi.entity_resource inside next_jsonapi.services.yml should have event_dispatcher as argument before %next_jsonapi.size_max%

Steps to reproduce:

  1. First '...'
  2. Then '....'
  3. 😢

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageA new issue that needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions