- Issue created by @gcb
- last update
over 1 year ago 48 pass - @gcb opened merge request.
- Status changed to Needs review
over 1 year ago 6:58pm 28 June 2023 - πΊπΈUnited States jhedstrom Portland, OR
Wow, that's bizarre. I wonder how this was ever working since
BaseFieldDefinition
is just checking the definition array (which is presumably also just usingview
andedit
):public function isDisplayConfigurable($display_context) { return $this->definition['display'][$display_context]['configurable'] ?? FALSE; }
- Status changed to Needs work
over 1 year ago 7:46pm 28 June 2023 - πΊπΈUnited States mariacha1
@jhedstrom I'm glad you're as confused as I am!
Tests don't fail, and it does look like that's why this was added in the first place.
My only note is that the "hook_jsonapi_entity_field_filter_access" hook below also checks against "display" and that should probably be "view" as well.
Otherwise this feels pretty good to me.
- πΊπΈUnited States jhedstrom Portland, OR
That code is from a very early port of the module to 8.x (commit
68bbb58
).There's one more use where the module hard codes
display
to that method call infield_permissions_jsonapi_entity_field_filter_access
that should be updated toview
I guess.(cross post!)
- last update
over 1 year ago 48 pass - Status changed to Needs review
over 1 year ago 6:06pm 3 July 2023 - πΊπΈUnited States gcb
Wow, that's an unheard-of level of responsiveness in the contrib queue in my experience. Two maintainers so quick they overlap!
Alright, I've added a fix for that line to my MR, let me know if there's more needed!
-
mariacha1 β
committed 4826f987 on 8.x-1.x authored by
gcb β
Issue #3371144: Invalid context for call to FieldDefinitionInterface->...
-
mariacha1 β
committed 4826f987 on 8.x-1.x authored by
gcb β
- Status changed to Fixed
over 1 year ago 2:47pm 5 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 6:26pm 15 October 2023 - π¬π§United Kingdom joachim
The fix is wrong:
$context = ($operation == 'view') ? 'view' : 'edit';
The docs in core say:
> * The display context. Either 'view' or 'form'.
'edit' is not a valid value.
- πΊπΈUnited States wxman
@jhedstrom @mariacha1 This bug is still not working. I created a new issue at #3394215 to show it's still crashing Computed Fields.
- @gcb opened merge request.
- πΊπΈUnited States gcb
Hrm, please ignore the extra branches an noise I made here. The fix is already in for the form/edit mismatch on the 8.x-1.x branch https://git.drupalcode.org/project/field_permissions/-/commit/003b4f069a...
- πΊπΈUnited States wxman
@gcb I am running the 8.x-1.2 version now and computed field still is not working, even my cron fails showing an error caused by Field Permissions
TypeError: Drupal\field_permissions\FieldPermissionsService::fieldGetPermissionType(): Argument #1 ($field) must be of type Drupal\field\FieldStorageConfigInterface, Drupal\computed_field\Field\FieldStorageDefinition given, called in /var/www/website/web/modules/contrib/field_permissions/src/FieldPermissionsService.php on line 163 in Drupal\field_permissions\FieldPermissionsService->fieldGetPermissionType() (line 138 of modules/contrib/field_permissions/src/FieldPermissionsService.php).
I'm going to do a backup and install the DEV an see if that works. Also the link above: https://git.drupalcode.org/project/field_permissions/-/commit/003b4f069a... says the fix was NOT added to the branch, unless I'm reading it wrong.
- πΊπΈUnited States gcb
Yes, as I said, it's on the dev branch. There hasn't been a release since it was merged, so you have to use the dev branch or treat the commit as a patch if you want it.