Problem/Motivation

I have a config entity which has an optional expression. I tried to do this using the following config schema:

my_module.config_entity_type.*:
  type: config_entity
  mapping:
    expression:
      type: rules_expression.[id]
      label: 'Expression configuration'
      nullable: true

This doesn't work, because if the value is NULL, there is no ID and so it can't find a data type, resulting in schema errors and failing tests.

Proposed resolution

Defining a catch-all for rules_expression.* solves this.

Data model changes

Additional catch all schema to allow nulls.

Comments

andrewbelcher created an issue. See original summary.

andrewbelcher’s picture

Assigned: andrewbelcher » Unassigned
Status: Active » Needs review
StatusFileSize
new450 bytes

Here's a patch that resolves it.

tr’s picture

Priority: Major » Minor
StatusFileSize
new508 bytes

Here's a re-roll with an added label for documentation purposes.

tr’s picture

Sigh, testbot is currently having problems... See #3099984: Composer require failure since Drupal 8.8.0

tr’s picture

I will be committing this as soon as the testbot is back up and running.

  • TR committed 42a11ff on 8.x-3.x authored by andrewbelcher
    Issue #2996421 by andrewbelcher: Impossible to make a rules_expression.[...
tr’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.