cache.jsonapi_resource_types can cause problems if a resource type is installed afterwards

Created on 15 May 2025, 21 days ago

Problem/Motivation

If you have an install profile that installs both jsonapi and commerce and commerce_api module you run into problems with errors like:

wid: '185'
uid: '0'
type: php
message: 'Drupal\jsonapi_resources\Exception\RouteDefinitionException: The commerce_api.carts.collection route definition''s _jsonapi_resource_types route default declares the resource type commerce_order but a resource type by that name does not exist. in Drupal\jsonapi_resources\Resource\ResourceBase->Drupal\jsonapi_resources\Resource\{closure}() (line 132 of /app/web/modules/contrib/jsonapi_resources/src/Resource/ResourceBase.php).'
severity: Error
location: 'https://drupal-cms.lndo.site/jsonapi/carts?include=order_items.purchased_entity'
referer: 'http://localhost:3000/'
hostname: 172.19.0.1
date: '15/May 13:51'
username: Anonymous

Steps to reproduce

Have an install profile that installs both jsonapi and some modules that add resource types.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

jsonapi.module

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024