Problem/Motivation

On a multi-value Frontify asset field, opening the Finder while editing an existing entity and picking additional assets loses the previously saved items: the widget clears its field state before resolving what was submitted, and the rebuilt form drops the kept selection (whose item weights come back as strings).

Steps to reproduce

1. Create an entity with a multi-value Frontify field holding 2 assets; save. 2. Edit it, open the Finder, pick a 3rd asset. 3. The previous 2 assets are gone from the widget.

Proposed resolution

Resolve the widget field state from the submitted selection before clearing it, and cast item weights to int so the rebuilt form tolerates the kept (string-weight) selection.

Tested against 3.0.1. We carry this as a composer patch in production (Drupal 11, PHP 8.4). Happy to open an MR if the approach is agreed.

Comments

julien created an issue. See original summary.

julien’s picture

Status: Active » Needs review
StatusFileSize
new2.43 KB

Attaching the patch we carry in production (against 3.0.1). Happy to turn it into an MR.