Access to admin/people view, reset configuration to default

Created on 4 October 2021, about 3 years ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

When I access to admin/people section, the module configuration is reset to default values

Steps to reproduce

- Create an extra entity form (step 1.png);
- Assign created form as default (step 2. png);
- Access to admin/people (step 3.png);

Details

The Configuration form /admin/structure/display-modes/form/config-form-modes serializes the selected modes in the configuration with key form_mode_control.settings

The exact configuration keeps the permissions and the selected form modes for each role.

drush config-get form_mode_control.settings

The roleToFormMode() method in web/modules/contrib/form_mode_control/src/FormModePermission.php file is called every time the user visits the Permissions table /admin/people/permissions.

The purpose of this method is to rebuild and serialize the permission. The highlighted lines below also try to clean up things and purge anything that is not reset. However, what remains is also the configuration of the display modes, something that is also removed.

This is what causes the misbehavior this ticket is about.

Solution(s)

A. Split the configuration keys

Use two places for storing configuration values

Permissions:form_mode_control.permissions
Here we store the values from the permissions table. The purge method needs no changes since it will have no side-effect when removing all the leftovers, as it currently does.

Form settings:
form_mode_control.settings
Here is where we store the link between the form modes and the user roles /admin/structure/display-modes/form/config-form-modes

B. Identify the entries before purge

This is what patch in Comment #9 🐛 Access to admin/people view, reset configuration to default Closed: cannot reproduce does.

It ignores the entries/line containing in their key the words creation and modification

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Miscellaneous

Created by

🇮🇹Italy krash Ragusa

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.

  • 🇳🇱Netherlands pefferen

    I just updated to 2.1 and removed the patch in #9 and can not reproduce the issue anymore, for me it this is solved by the merge of #3228381 by @mandclu , thanks!

  • Status changed to Closed: cannot reproduce over 1 year ago
  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    Sounds like this is resolved. Patch no longer applies since that code has changed.

Production build 0.71.5 2024