Convert settings from serialize to json_encode

Created on 23 August 2023, about 1 year ago
Updated 11 September 2023, about 1 year ago

Problem/Motivation

With the recent update of the ACL module to 1.4, the format of $element['user_list']['#default_value'] has changed from serialize() to json_encode().

The Content Access module relies on checking the element's user_list in order to show the fieldset as expanded/collapsed. The change to the ACL module means that trying to unserialize #default_value will always return false, and therefore the fieldset will always be collapsed. This change only affects UX and is non-critical.

Steps to reproduce

After upgrading to ACL 1.4, visit the Access Control tab. Under the User Access Control Lists fieldset, all sub-fieldsets will always be collapsed even if they contain a list of users.

Proposed resolution

Change how $form['acl'][$op]['user_list'] is checked.

Fortunately, the ACL module provides a helper function to simplify this change: acl_edit_form_get_user_list()

Both the forum_access and flexiaccess modules already contain examples of this change.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States hargobind Austin, Texas

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

Comments & Activities

Production build 0.71.5 2024