daterange_default widget - date_increment config missing schema

Created on 24 September 2020, over 4 years ago
Updated 4 May 2024, 8 months ago

Problem/Motivation

The widget with ID daterange_default is defined in \Drupal\datetime_range\Plugin\Field\FieldWidget\DateRangeDefaultWidget. Its grandparent class (i.e.: parent class' parent class), \Drupal\datetime\Plugin\Field\FieldWidget\DateTimeWidgetBase gets/sets a date_increment setting, which gets exported to core.entity_form_display.* configurations.

However, this date_increment setting is not defined in the widget's field.widget.settings.[widget_name] config schema definition . See the change record for Configuration schema for field settings, default values and entity view/form displays changed in 8.0.0 for more information.

Steps to reproduce

Try to install a module that defines a field of type daterange with a widget of type daterange_default inside a test environment (I happen to be using drupal-8.9.6 at the time-of-writing but the config definition is missing in 9.0.x and 9.1.x): you will see an error like:

1) Drupal\Tests\example\Functional\ExampleTest::testExample
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for core.entity_form_display.node.example.default with the following errors: core.entity_form_display.node.example.default:content.field_example.settings.date_increment missing schema

web/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php:95
web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php:111
web/core/lib/Drupal/Core/Config/Config.php:231
web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:284
web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:457
web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:263
web/core/lib/Drupal/Core/Entity/EntityBase.php:395
web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:616
web/core/lib/Drupal/Core/Config/ConfigInstaller.php:371
web/core/lib/Drupal/Core/Config/ConfigInstaller.php:137
web/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php:75
web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:287
web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:83
web/core/includes/install.core.inc:1649
web/core/includes/install.core.inc:695
web/core/includes/install.core.inc:570
web/core/includes/install.core.inc:118
web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:296
web/core/tests/Drupal/Tests/BrowserTestBase.php:573
web/core/tests/Drupal/Tests/BrowserTestBase.php:406
web/modules/custom/example/tests/src/Functional/ExampleTest.php:41

Proposed resolution

Update the configuration schema for field.widget.settings.daterange_default in core/modules/datetime_range/config/schema/datetime_range.schema.yml to look like:

field.widget.settings.daterange_default:
  type: mapping
  label: 'Date range default display format settings'
  mapping:
    date_increment:
      type: integer
      label: 'Date Increment'

(this is similar to the definition for field.widget.settings.datetime_default in core/modules/datetime/config/schema/datetime.schema.yml)

Remaining tasks

  1. Review and feedback
  2. RTBC and feedback
  3. Commit to 9.1.x
  4. Backport to 9.0.x
  5. Backport to 8.9.x

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

I daresay this problem isn't exciting enough to warrant a release notes snippet, but just in case,

Added missing date_increment config schema to daterange_default widget.

Documentation links

  1. Documentation -> Drupal -> Drupal APIs -> Configuration API -> Configuration schema/metadata
  2. Drupal core Change records -> Configuration schema for field settings, default values and entity view/form displays changed
🐛 Bug report
Status

Closed: cannot reproduce

Version

11.0 🔥

Component
Datetime 

Last updated 6 days ago

Created by

🇨🇦Canada mparker17 UTC-4

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.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

    As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" more than 6 months ago with another request for more information and there has been no activity since that time.

    Since we need more information to move forward with this issue, I am tagging for Bug Smash Initiative and keeping the status at 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!

  • Status changed to Closed: cannot reproduce 8 months ago
Production build 0.71.5 2024