\Drupal\Core\Config\Schema\Mapping cannot cast NULL to [] and does not consider it valid

Created on 14 December 2015, about 9 years ago
Updated 18 August 2023, over 1 year ago

Problem/Motivation

If NULL is saved for a config value that is expected to be an array, two things happen:
1) It does not cast it to an empty array
2) It fatals, saying that NULL is invalid

Primitive types like Interger have a getCastedValue(), but it's only used for checking, and NULL is still saved (instead of 0).
I think that second part is actually #2345813: Primitive TypedData fields are not cast properly β†’

Proposed resolution

Either allow Mapping to contain NULL, or cast it to an empty array internally

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

9.5

Component
Typed dataΒ  β†’

Last updated 16 days ago

  • Maintained by
  • πŸ‡¦πŸ‡ΉAustria @fago
Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

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

    Since there has not been a follow up to #14 going to close out for now.

    If still a bug please reopen updating issue summary with steps to reproduce in D10+

    Thanks all

Production build 0.71.5 2024