[PP-1] Return validation errors from LayoutController::post and ::patch

Created on 7 February 2025, 2 months ago

Overview

We currently don't show perform any validation when posting to api/preview/{entity_type}/{entity}
In πŸ“Œ Support server side massage and validation of component prop form values Active we move this to POST:api/layout/{entity_type}/{entity} and add PATCH:api/layout/{entity_type}/{entity}
But still there is no validation.
If we turn on validation, we get an error when adding a component with an empty slot (this is reinforced by \Drupal\Tests\experience_builder\Kernel\ApiLayoutControllerPostTest::testMissingSlot

Proposed resolution

Turn on validation
Display validation issues to the user
Work out how to deal with empty slots (relax validation perhaps?)
In a layout builder world it is perfectly reasonable to have empty regions, so relaxing this would help us with an LB update path.
Remove the optional $validate = FALSE flag argument on \Drupal\experience_builder\ClientDataToEntityConverter::convert

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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

Comments & Activities

Production build 0.71.5 2024