XB allows saving invalid date range field values

Created on 21 April 2025, about 10 hours ago

Overview

Researching πŸ“Œ [PP-1] Return validation errors from LayoutController::post and ::patch Active I wanted to see if you could save an invalid date range value into auto-save. I thought maybe we would actually want to allow saving invalid field values in auto-save so that you could still save work-in-progress. this might be important because you might have updated many fields after you set an invalid date range(or another field) and you won't want that to stop the auto-save

I choose the date range field because I know how to easily set an invalid field value, set the end before the start

I was able to do the auto-save but I was also able to save node with the invalid date range.

I am not sure if there is problem just with date ranges or any field that we can get an invalid value past the client validation.

In \Drupal\experience_builder\ClientDataToEntityConverter::convert() we do call $entity->validate() and we do this regardless of the value of $validate. so in theory that should throw an error if ClientDataToEntityConverter::convert() is called from \Drupal\experience_builder\Controller\expected_auto_saves which happens on "Publish all" or \Drupal\experience_builder\Controller\ApiLayoutController::buildPreviewRenderable() which happens when we are auto-saving.

Proposed resolution

Determine if this is problem unique to date range fields or any invalid field value

fix

User interface changes

πŸ› Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

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

Comments & Activities

Production build 0.71.5 2024