Fix system.date config schema violations: timezone.default

Created on 7 August 2023, 10 months ago

Problem/Motivation

Discovered in πŸ“Œ Configuration schema & required values: add test coverage for `nullable: true` validation support Fixed .

For example:

1) Drupal\Tests\system\Functional\Datetime\DrupalDateTimeTest::testDateTimezone
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for system.date with the following errors: 0 [timezone.default] This value should not be null.

Steps to reproduce

Run Drupal core's test suite with πŸ“Œ Configuration schema & required values: add test coverage for `nullable: true` validation support Fixed applied, and with the lines

    'system.date' => [
      // @todo Fix config or tweak schema of `type: system.date`.
      // @see system.schema.yml
      'timezone.default' => [
        'This value should not be null.',
      ],
    ],

removed from \Drupal\Core\Config\Schema\SchemaCheckTrait::checkConfigSchema().

Proposed resolution

Solution: fix invalid config schema: it should allow timezone.default to be null: add nullable: true. Why? Because:

  1. based on the logic in \Drupal\Tests\system\Functional\Datetime\DrupalDateTimeTest::testDateTimezone() this seems intentional
  2. based on the default of timezone.default: 0 in core/modules/system/config/install/system.date.yml, zero and null seem to behave the same

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
SystemΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

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

Comments & Activities

Production build 0.69.0 2024