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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | field_permission_jsonapi_extras_fieldbase_support.patch | 2.09 KB | andrei.vesterli |
Issue fork field_permissions-3460848
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
Comment #2
japerryI would look at the dev version, I think I fixed this issue yesterday.
Comment #3
andrei.vesterliHey @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.
Comment #4
japerryPushed an MR that fixes some underlying Interface definitions and adds a fallback if getThirdPartySetting is missing.
Comment #6
japerryComment #8
andrei.vesterli