Problem/Motivation

When i am using filtering the orders using the jsonapi routings i am getting a crash:
Error: Call to undefined method Drupal\Core\Field\BaseFieldDefinition::getThirdPartySetting() in Drupal\field_permissions\FieldPermissionsService->fieldGetPermissionType() (line 140 of /app/docroot/modules/contrib/field_permissions/src/FieldPermissionsService.php)

Steps to reproduce

Context:
1. Drupal core 9.5.11
2. PHP version: 8.1.28
3. field_permissions: 1.3
4. Using the module JSONAPI:Extras and the routing with displaying orders /jsonapi/commerce_orders/default?filter[state]=draft

Proposed resolution

1. Write a patch that will handle both field definitions FieldStorageConfigInterface | BaseFieldDefinition
2. If the type is BaseFieldDefinition just return FieldPermissionTypeInterface::ACCESS_PUBLIC for this method: fieldGetPermissionType

Remaining tasks

Patch.

User interface changes

No.

API changes

No.

Data model changes

No.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andrei.vesterli created an issue. See original summary.

japerry’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Status: Needs work » Postponed (maintainer needs more info)

I would look at the dev version, I think I fixed this issue yesterday.

andrei.vesterli’s picture

Hey @japerry

Thx for a quick response. Nope, I don't intend to use dev version. Also, I tested with the dev version before I posted this issue, and the same. Here you can see my working patch. I will just use it before the real issue will be fixed.

japerry’s picture

Status: Postponed (maintainer needs more info) » Needs review

Pushed an MR that fixes some underlying Interface definitions and adds a fallback if getThirdPartySetting is missing.

japerry’s picture

Status: Needs review » Fixed

  • japerry committed 10109aac on 8.x-1.x
    Issue #3460848: Error: Call to undefined method Drupal\Core\Field\...
andrei.vesterli’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.