Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider breaks if switching datatype from numeric #11259

Closed
bjarnef opened this issue Oct 4, 2021 · 2 comments
Closed

Slider breaks if switching datatype from numeric #11259

bjarnef opened this issue Oct 4, 2021 · 2 comments
Labels

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Oct 4, 2021

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

9.0.0

Bug summary

General speaking I think there is not great support for switching property editor on an existing property. Often you'll need to remove the property and re-publish the content node or add the property as a new property with a different alias.

E.g. if having an block settings property using Numeric datatype and switching property to a Slider datatype, it break here:
https://github.com/umbraco/Umbraco-CMS/blob/v9/contrib/src/Umbraco.Web.UI.Client/src/views/propertyeditors/slider/slider.controller.js#L49

This is due the value is stored as an numeric value, which hasn't a split() function.

We could probably improve this a bit further using Utilities.isString() to check whether $scope.model.value is a string and only split if it is otherwise fallback to null.
https://github.com/umbraco/Umbraco-CMS/blob/v9/contrib/src/Umbraco.Web.UI.Client/src/utilities.js#L58

Specifics

No response

Steps to reproduce

  • Create a property using Numeric datatype on a document type.
  • On the content node save a numeric value in the property.
  • Go back to the document type and change the datatype of the property to a Slider datatype.
  • On the content node notice the console error and the slider isn't shown.

Expected result / actual result

No response

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 5, 2021

I checked if it was an issue in latest v8 as well, but I couldn't reproduce on a content node or in content of a block element.
First when I changed a numeric property on a block settings element type to a slider datatype, I got the same issue, which was the same scenario as when I reported this issue.

image

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 24, 2021

Fixed in #11287

@bjarnef bjarnef closed this as completed Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant