PATCH request for config entities reset values that are not sent

Created on 20 February 2025, about 1 month ago

Overview

Discovered in ✨ Managing components sourced as code components Active which was doing a PATCH request to rename a code component. The request only sent the name and id. Because \Drupal\experience_builder\Controller\ApiConfigControllers::patch called \Drupal\experience_builder\Entity\JavaScriptComponent::denormalizeFromClientSide with the data from the client and that method has lines like 'props' => $data['props'] ?? [], which will wipe out the props if it was not sent from the client

Proposed resolution

Don't require the client to send all the keys. Maybe add an optional $entity argument to denormalizeFromClientSide that would set on PATCH requests

User interface changes

πŸ› Bug report
Status

Active

Version

0.0

Component

Internal HTTP API

Created by

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

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024