Clean up CE display settings on save (or earlier)

Created on 22 May 2024, 25 days ago

Problem/Motivation

Steps to reproduce

Scenario:

I have some (multi-value) field, selected with some Core Field formatter that has a settings form. (Example: link field in our standard tests' link paragraph.)

These have settings, e.g.

  field_link:
    formatter: raw
    name: link
    is_slot: false
    weight: 0
    region: content
    configuration:
      is_slot: false
      settings:
        trim_length: '80'
        url_only: '1'
        url_plain: 0
        rel: 0
        target: 0

Now, in the respective "Manage Custom Elements" tab, I change to "Raw" formatter, save and export the CE display.

The "settings" sub array is not removed from the exported values, even though it is unused.

Proposed resolution

Prune the 'configuration' array, sometime. (Just before saving, or at an earlier point.)

Make sure 'is_slot' is not inside the configuration array; only the 'outer' is_slot value is used/valid. (Hint: 'name' is not duplicated, don't know why)

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands roderik Amsterdam,NL / Budapest,HU

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

Comments & Activities

Production build 0.69.0 2024