Problem/Motivation

When editing a layout block with a required field (or other validation logic), it is impossible to dismiss/cancel the dialog until all validation errors are resolved. Validation should not run when cancelling the form.

Additionally, a validation error appears if other fields on the block are edited before the required field is filled in, and the instant preview does not appear until all validation errors are resolved.

Steps to reproduce

Create a custom block type with a required text field.
Begin adding a block of that type to a layout page, and then cancel the dialog before filling in the text field. The dialog cannot be dismissed.

Proposed resolution

Do not run form validation when cancelling or previewing a block. Only run it when saving the block.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bgreco created an issue. See original summary.

bgreco’s picture

bgreco’s picture

Status: Active » Needs review

  • dsnopek committed a3950cd on 8.x-2.x authored by bgreco
    Issue #3173176 by bgreco: Instant preview validation errors
    
dsnopek’s picture

Status: Needs review » Fixed

Thanks so much! This works great in my testing and fixes a super annoying issue. Committed! :-)

Status: Fixed » Closed (fixed)

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