Cleanup saving of an array into config file

Created on 15 December 2013, over 11 years ago
Updated 7 March 2025, about 1 month ago

Problem/Motivation

When saving a checkboxes element (or an array of values indexed by key) into config file,

1) Saving the selected values in value: value format.
2) The values that are not selected are saving in file with value 0.

Example:

'remember_roles' is a checkboxes element in views access plugin and provide list of roles(in our example, authenticated, anonymous and administrator). When select just 'authenticated' role it gets saved as below:

remember_roles:
  authenticated: authenticated
  anonymous: '0'
  administrator: '0'

Proposed resolution

If we can solve both problem #1 and #2, it will be:

remember_roles:
  - authenticated

Remaining tasks

1. Identify all instance
2. Issue patch

User interface changes

No

API changes

No

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

configuration system

Created by

πŸ‡¬πŸ‡§United Kingdom vijaycs85 London, UK

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024