- Issue created by @mstrelan
- Merge request !10224Add AccessResultInterface return type to hook_entity_access (and friends) implementations β (Closed) created by mstrelan
- π¦πΊAustralia mstrelan
There is at least one instance in ContentModerationHooks where this might return null instead of an AccessResultInterface. It should probably return a neutral access result.
- π¦πΊAustralia mstrelan
Updated
ContentModerationHooks::entityAccess
to returnAccessResult::neutral()
instead ofNULL
. - πΊπΈUnited States smustgrave
Applied the MR locally
Did a search for
#[Hook('entity_field_access')]
#[Hook('entity_access')]
_entity_access(And all instances appear to be updated.
- π¦πΊAustralia mstrelan
Found a few more for
hook_ENTITY_TYPE_access
andhook_ENTITY_TYPE_create_access
:Drupal\field_ui_test\Hook\FieldUiTestHooks::fieldConfigAccess() Drupal\layout_builder\Hook\LayoutBuilderHooks::blockContentAccess() Drupal\media_library\Hook\MediaLibraryHooks::imageStyleAccess() Drupal\media_library_test\Hook\MediaLibraryTestHooks::mediaCreateAccess() Drupal\node\Hook\NodeHooks1::nodeAccess() Drupal\node_access_test\Hook\NodeAccessTestHooks::nodeAccess() Drupal\config_test_rest\Hook\ConfigTestRestHooks::configTestAccess() Drupal\user_access_test\Hook\UserAccessTestHooks::userAccess() Drupal\workflow_type_test\Hook\WorkflowTypeTestHooks::workflowAccess() Drupal\workspace_access_test\Hook\WorkspaceAccessTestHooks::workspaceAccess()
- π¦πΊAustralia mstrelan
Rebased and added return type to methods listed in #8.
Also added
AccessResult::neutral
toMediaLibraryHooks::imageStyleAccess
when nothing else is returned. - π¦πΊAustralia mstrelan
Added steps to reproduce. Note the grep pattern is excluding jsonapi because these implement
hook_jsonapi_ENTITY_TYPE_filter_access
and returnarray
. - πΊπΈUnited States smustgrave
Searching for the additional items mentioned in #8 believe those have been addressed too.
- πΊπΈUnited States smustgrave
Believe the 1 open question has been answered. My 2 cents is don't think it needs to be changed.
- First commit to issue fork.
-
larowlan β
committed 28d9f5c1 on 11.x
Issue #3488109 by mstrelan, quietone: Add AccessResultInterface return...
-
larowlan β
committed 28d9f5c1 on 11.x
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Committed to 11.x - thanks!
Automatically closed - issue fixed for 2 weeks with no activity.