Active
Project:
Content Access
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2022 at 12:53 UTC
Updated:
12 Dec 2023 at 18:27 UTC
Jump to comment: Most recent
"Reset to defaults" button for custom node settings triggers submit function pageResetSubmit()
where $grants are retrieved using
$grants = $this->entityTypeManager->getAccessControlHandler('node')->acquireGrants($node);
But this will get current node grants, and trigger no update of `node_access` table. So original access settings is still considered, which is wrong.
Corresponding lines in table will be deleted when running cache rebuild (e.g. drush php-eval 'node_access_rebuild();'), but there is no message warning about it.
IMHO will be much better to call this content_access_get_type_grant() function to get default content_type grants settings which will be then applied
$grants = content_access_get_type_grant($node);
This solution seems to be working well.
Comments
Comment #2
gisleAll bug fixes go into the most recent branch.
Comment #3
osopolar"Reset to defaults" and submitting the defaults again sets the right grants. Could it be related to caches?