Skip to content

Slider property editor: Fix for preset value handling of enableRange#20772

Merged
AndyButland merged 1 commit intoumbraco:mainfrom
Luuk1983:v17/bugfix/20771-slider-prevalue
Nov 9, 2025
Merged

Slider property editor: Fix for preset value handling of enableRange#20772
AndyButland merged 1 commit intoumbraco:mainfrom
Luuk1983:v17/bugfix/20771-slider-prevalue

Conversation

@Luuk1983
Copy link
Contributor

@Luuk1983 Luuk1983 commented Nov 7, 2025

Prerequisites

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

This fixes #20771

Description

This fixes an issue where a slider data type would incorrectly give validation errors when publishing a content node. The value presets of the slider do not correctly handle the enableRange setting which caused it to be always true if the enabledRange property is in the configuration, regardless of it's value.

The steps setting was also incorrectly handled (it would always be 1), although that impact is extremely limited because it's only used in a fallback scenario.

I think that the steps to reproduce are clear in the associated issue, otherwise I'm happy to provide more details.

Updated the `UmbSliderPropertyValuePreset` class to ensure the `.value` property is accessed for configuration items. This change improves the accuracy of retrieving `enableRange`, `min`, `max`, and `step` values, addressing potential bugs in value processing.
Copilot AI review requested due to automatic review settings November 7, 2025 16:56
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Hi there @Luuk1983, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

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 a bug in the slider property value preset where configuration values were being accessed incorrectly. The code was attempting to use entire DataTypePropertyPresentationModel objects as fallback values instead of accessing their .value property.

Key Changes:

  • Fixed enableRange config access to use .value property (line 9)
  • Fixed step config access to use .value property and wrapped in Number() for type consistency (line 18)
  • Updated commented-out code for min and max to follow the corrected pattern (lines 12-13)

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

Thanks @Luuk1983 for reporting and providing the fix. I can see the error here as you've identified, and that your fix will now correctly retrieve the value. I've verified also that it does.

@AndyButland AndyButland changed the title Fix for slider preset value handling of enableRange Slider: Fix for preset value handling of enableRange Nov 9, 2025
@AndyButland AndyButland changed the title Slider: Fix for preset value handling of enableRange Slider property editor: Fix for preset value handling of enableRange Nov 9, 2025
@AndyButland AndyButland merged commit 04918ec into umbraco:main Nov 9, 2025
34 of 35 checks passed
@Luuk1983 Luuk1983 deleted the v17/bugfix/20771-slider-prevalue branch November 10, 2025 09:28
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.

Slider on a new page can give incorrect validation errors caused by property value preset

2 participants