Adding or editing a block through the UI saves the entity twice

Created on 10 October 2016, about 8 years ago
Updated 10 April 2024, 8 months ago

Problem/Motivation

Both BlockForm::submitForm() and EntityForm::save() save the entity.

Condition plugins with valid schemas are only correctly handled because BlockForm *saved the block twice*. Once explicitly in ::submitForm(), once in its parent ::save().
The flow was:

  1. condition is checked for default state, failed due to type mismatch
  2. saved in submitForm()
  3. values casted to correct type by Config::castValue
  4. condition is checked for default state, correctly removed
  5. saved in save()

Proposed resolution

In order to properly compare the values without saving the entity twice, the values must be cast before being compared.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

10.1 ✨

Component
BlockΒ  β†’

Last updated 5 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024