Asset Form: Removing all files doesn't work

Created on 10 August 2023, 11 months ago
Updated 14 August 2023, 11 months ago

Problem/Motivation

When adding files on the component_library asset form and removing all files again, the last file cannot be removed currently.

Steps to reproduce

  • Navigate to /admin/structure/component-library/assets/add
  • Click ADD CSS
  • Click ADD JS
  • Click the delete link below the CSS file's field
  • Click the delete link below the JS file's field

Expected result: The JS file's field gets removed.
Actual result: The JS file's field is not removed. When adding some code and saving the asset in this state, this leads to a corrupt library definition which will break the site until the asset's config is removed.

Proposed resolution

Fix ComponentLibraryAssetForm so that the file fields and the form state reflect the correct state of the form when deleting/adding CSS/JS files.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024