Skip to content

Property editors: Ensure values no longer allowed as options in checkbox list configuration are removed from the value, such that they will be removed from the persisted data when saved#20208

Merged
kjac merged 1 commit intov13/devfrom
v13/bugfix/remove-invalid-check-box-list-values
Sep 22, 2025
Merged

Conversation

@AndyButland
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Brought to attention from Umbraco support case.

Description

I have a customer that had updated a Checkboxlists predefined values, and those new values are reflecting in the backoffice to pick from but when they pick one and publish the content node, the frontend is still showing one of the old predefined values?

I've verified I can replicate the problem via:

  • Creating a property using check box list with options A, B and C
  • Created a document using the property and checked A and B
  • Rendered and as expected I see A and B
  • Removed B as an option
  • As expected - on the front-end, I still see A and B
  • As expected - in the backoffice I can now only select A and C
  • Republished the page with and without changing the values - I still see B on the front-end and can't get rid of it.

So basically once a value is allowed for selection and selected, you can't remove it.

I've resolved it in this PR by, on the client, when initialising the checkbox list property editor, removing any values from the model that are no longer valid according to the configuration. With that done, when the document is saved, the no longer valid values are removed.

Maybe this isn't how we'd want to handle it in the latest version, where we try not to silently modify values and rather given the editor the option to see and explicitly remove the no longer valid value - for 13 I think this is a reasonable approach, it requires much less effort on the client-side. And otherwise you are a bit stuck, short of modifying values in the database tables.

…tion are removed from the value, such that they will be removed from the persisted data when saved.
Copilot AI review requested due to automatic review settings September 20, 2025 13:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where checkbox list property editors retain values that are no longer available in the configuration options. When a checkbox list's predefined values are updated (e.g., removing an option), previously selected values that are no longer valid continue to persist in the content, even after republishing.

  • Adds validation to filter out invalid values from the model when the checkbox list controller initializes
  • Ensures that when content is saved, only currently valid configuration options are persisted
  • Provides a clean solution for v13 that automatically removes orphaned values without requiring manual intervention

Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised 👍

For good measure I also tested the dropdown in multi-select config, and that works as-is, so no need to apply a similar fix here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants