[11] Schema Validation errors: Incompatible types

Created on 2 July 2024, 5 months ago
Updated 21 July 2024, 4 months ago

Problem/Motivation

There are couple of schema definitions which contains incompatible types. For ex: Schema definitions should be an object while it contains an array. When running tests on Drupal Core 11, it throws an error and fails the tests. Ex errors:

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for rules.reaction.rule1 with the following errors: rules.reaction.rule1:expression.conditions.conditions.0 missing schema, rules.reaction.rule1:expression.actions.actions.0 missing schema, rules.reaction.rule1:expression.actions.actions.1 missing schema

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for rules.reaction.rule1 with the following errors: rules.reaction.rule1:expression.conditions.conditions.0.context_mapping.data missing schema, rules.reaction.rule1:expression.actions.actions.0.context_mapping.entity missing schema

Proposed resolution

We've to fix all schema definitions which contains incompatible types.
Affected schema definitions:

  1. rules.context.schema.yml
  2. rules.expression.schema.yml
  3. rules.data_types.schema.yml

We've to update each of the above schema definitions and fix the error because it expects an object, while we provided an array.

Before:

sequence:
  - type: rules.context.definition

After:

sequence:
  type: rules.context.definition
📌 Task
Status

Fixed

Version

4.0

Component

Rules Core

Created by

🇮🇳India vishalkhode

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024