Condition Plugins Saving Improperly

Created on 1 May 2023, almost 2 years ago
Updated 10 May 2023, almost 2 years ago

Problem/Motivation

I was having trouble with the tag not firing upon install / upgrade *after* saving the configuration form. For some reason, the Group module's GroupType plugin was saving itself into this module's configuration, even though no group types or negation was selected. After looking at what was saved to the tag container entity's conditions, the group type negation was different than all the rest. It was stored as an integer instead of a boolean. This broken configuration was not allowing the tag to fire anywhere.

It seems there's some strict type checking on the negation of any given condition. According to Core config schema, the 'negate' value must be a boolean.

https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/config/sche...

Steps to reproduce

Have the Group module installed.
Upgrade this module to 2.x.
Save the config form.
No dataLayer.

Proposed resolution

Cast all negation values on condition configuration to a boolean during condition save.

Remaining tasks

See MR.

User interface changes

None.

API changes

None.

Data model changes

Prior configurations may be updated from integer to boolean, which is the Core data type. This is the way.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States alexandersluiter

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

Comments & Activities

Production build 0.71.5 2024