Config form saves wrong value types

Created on 4 November 2021, about 3 years ago
Updated 12 May 2023, over 1 year ago

Problem/Motivation

The settings form saves the wrong value types. For boolean fields it saves them as "1" or "0" instead of "true" and "false".

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

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.

  • 🇩🇪Germany Anybody Porta Westfalica

    Should indeed be fixed in the implementation and schema. In general a config schema check should be done.

  • First commit to issue fork.
  • 🇩🇪Germany Anybody Porta Westfalica

    Eventually the existing values have to be updated? If not, even better and less work!

  • Status changed to Closed: works as designed over 1 year ago
  • 🇩🇪Germany Grevil

    This is not true. All boolean fields are saved as boolean, and there are no schema errors, see exported "purge_users.settings.yml":

    user_never_lastlogin_value: ''
    user_never_lastlogin_period: days
    user_lastlogin_value: '12'
    user_lastlogin_period: days
    user_inactive_value: ''
    user_inactive_period: days
    user_blocked_value: ''
    user_blocked_period: days
    enabled_never_loggedin_users: false
    enabled_loggedin_users: true
    enabled_inactive_users: false
    enabled_blocked_users: false
    purge_included_users_roles:
      authenticated: authenticated
      content_editor: content_editor
      administrator: '0'
    purge_on_cron: false
    inactive_user_notify_subject: 'Your account is deleted'
    inactive_user_notify_text: "Dear User, \r\n\r\nYour account has been deleted due the website’s policy to automatically remove users who match certain criteria. If you have concerns regarding the deletion, please talk to the administrator of the website. \r\n\r\nThank you"
    send_email_notification: false
    purge_user_cancel_method: user_cancel_reassign
    disregard_blocked_users: false
    purge_excluded_users_roles:
      administrator: administrator
      content_editor: '0'
    user_before_deletion_subject: 'Your account will be deleted'
    user_before_deletion_text: "Dear User, \r\n\r\nYour account will be deleted soon due the website’s policy to automatically remove users who match certain criteria. If you have concerns regarding the deletion, please talk to the administrator of the website.  \r\n\r\nThank you"
    send_email_user_before_notification: false
    user_before_notification_value: ''
    user_before_notification_period: days
    

    NOTE, that the '0' values are coming from the checkboxes values, which saves values as '0', when they are not selected.

Production build 0.71.5 2024