non-existing permissions are imported with SQL error, never removed

Created on 6 June 2017, about 7 years ago
Updated 8 December 2023, 7 months ago

Problem/Motivation

If a permissions is exported to the master feature, it can be imported on a database/codebase where this permission is not valid (eg: module does not exist, node type does not exist.). It will be imported to the "role_permission" table. Import (revert) will fail with an error:
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null'
After the import, the permission will not be removed when exporting (update) the master feature. Only the "$roles" array will be emptied.

Proposed resolution

add extra check before executing user_role_change_permissions?

πŸ› Bug report
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands keesje

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