Reset to defaults not working as expected

Created on 5 April 2022, about 2 years ago
Updated 12 December 2023, 7 months ago

Problem/Motivation

"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.

Steps to reproduce

Proposed resolution

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.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡ΏCzech Republic Bohus Ulrych Pilsen (Czechia)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024