Skip to content

fix(next): make EntityResource constructor compatible with Drupal 10/11#882

Merged
bojanbogdanovic merged 2 commits intochapter-three:mainfrom
bojanbogdanovic:877-entity-resource-constructor
Dec 24, 2025
Merged

fix(next): make EntityResource constructor compatible with Drupal 10/11#882
bojanbogdanovic merged 2 commits intochapter-three:mainfrom
bojanbogdanovic:877-entity-resource-constructor

Conversation

@bojanbogdanovic
Copy link
Collaborator

Fixes #877

This pull request is for:

  • modules/next

GitHub Issue: #877

Description:

This PR updates EntityResource to work across Drupal 10 and 11 by refactoring the constructor to handle variable parent arguments and inject $maxSize as a parameter.

Background / Difference between D10 and D11:

  • In Drupal 10, the parent EntityResource constructor has a certain set and order of service arguments (EntityTypeManager, Serializer, Logger, etc.).
  • In Drupal 11, the parent constructor signature changed: some services were added, removed, or reordered.
  • This difference causes TypeErrors when trying to extend or decorate the service with a fixed constructor argument order.

@vercel
Copy link

vercel bot commented Dec 17, 2025

@bojanbogdanovic is attempting to deploy a commit to the Chapter Three Team on Vercel.

A member of the Team first needs to authorize it.

@bojanbogdanovic bojanbogdanovic force-pushed the 877-entity-resource-constructor branch from 8295a51 to 8e4b16a Compare December 18, 2025 16:40
@bojanbogdanovic bojanbogdanovic merged commit cabf7c5 into chapter-three:main Dec 24, 2025
13 of 16 checks passed
bojanbogdanovic added a commit that referenced this pull request Dec 26, 2025
Replaced constructor injection with a setter method to reduce the risk of BC breaks from the parent class.

Removed the redundant service definition from services.yml, relying solely on the ServiceProvider for service configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drupal's JSON:API EntityResource requires EventDispatcher as dependency

2 participants