500 error with JSONAPI on Base Entity Fields

Created on 2 January 2024, 6 months ago
Updated 19 March 2024, 3 months ago

Problem/Motivation

Hi,

After upgrading a site with a custom entity type that has entity reference fields in BaseFieldDefinitions to Drupal 10.2.0 and Field Permissions to 1.3, my JSONAPI calls that load the custom entity type now return a 500 error:

Drupal\field_permissions\FieldPermissionsService::fieldGetPermissionType(): Argument #1 ($field) must be of type Drupal\field\FieldStorageConfigInterface, Drupal\Core\Field\BaseFieldDefinition given, called in /var/www/html/web/modules/contrib/field_permissions/src/FieldPermissionsService.php on line 198

Steps to reproduce

1. Create a custom entity type with an entity reference base field.
2. Enable JSONAPI.
3. Attempt to retrieve JSONAPI results containing content with this entity type.

Proposed resolution

It looks very similar to ๐Ÿ› TypeError: Drupal\field_permissions\FieldPermissionsService::fieldGetPermissionType(): Argument #1 ($field) must be of type Drupal\field\FieldStorageConfigInterface Fixed -- however, that fixed a hook implementation, and a similar fix is needed in the service file.

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States freelock Seattle

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024