Fix system.date config schema violations: timezone.default

Created on 7 August 2023, over 1 year ago
Updated 11 July 2024, 7 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

Closed: outdated

Version

11.0 🔥

Component
System 

Last updated 6 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

  • Issue created by @wim leers
  • Status changed to Needs review 7 months ago
  • 🇮🇳India narendraR Jaipur, India

    I think this is not an issue anymore and can be closed as outdated. Moving it to NR, so as to get more eyes on it.

  • 🇧🇪Belgium borisson_ Mechelen, 🇧🇪

    We no longer have the array of ignore things in ChemaCheckTrait, as far as I can see, so I think you're right that this can be closed.

  • Status changed to Closed: outdated 7 months ago
  • 🇺🇸United States smustgrave

    Thanks for flagging and confirming both of you

Production build 0.71.5 2024