Problem/Motivation

Smart Date replaces the core Views date argument plugin with its own Date plugin (Drupal\smart_date\Plugin\views\argument\Date), which adds two additional options: format and granularity. However, the config schema for views.argument.date does not include these keys.

This causes ConfigSchemaChecker errors during recipe application or config import when a Views config includes a date argument that uses these options:

Schema errors for views.view.my_schedule with the following errors:
views.view.my_schedule:display.attachment_1.display_options.arguments.field_when_value.format missing schema
views.view.my_schedule:display.attachment_1.display_options.arguments.field_when_value.granularity missing schema

Proposed resolution

Implement hook_config_schema_info_alter() in a SmartDateHooks class to dynamically add the date_token, format, and granularity keys to the views.argument.date schema definition. This mirrors the existing approach already used for views.filter_value.date granularity.

The hook class follows the Drupal 11 OOP hook pattern, with the procedural smart_date_config_schema_info_alter() function in smart_date.module retained and marked #[LegacyHook] for backwards compatibility.

Issue fork smart_date-3604092

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mandclu created an issue. See original summary.

  • mandclu committed 1dbf3bf3 on 4.2.x
    fix: #3604092 views.argument.date schema missing format and granularity...
mandclu’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.