umbraco / UmbracoDocs

The official Umbraco Documentation
https://docs.umbraco.com
MIT License
266 stars 769 forks source link

Creating an xml site map slider only acepting int #6441

Open carlhope opened 1 week ago

carlhope commented 1 week ago

What type of issue is it? (Choose one - delete the others)

Discussion not sure if this is an issue with documentation or a bug to be fixed. Slider only accepts integers and this documentation is using doubles.

What article/section is this about?

https://docs.umbraco.com/umbraco-cms/tutorials/creating-an-xml-site-map

Describe the issue

Slider only allows integers. Trying to update priority results in error with "The JSON value could not be converted to System.Int32. Path: $.from | LineNumber: 0 | BytePositionInLine: 11. A fatal server error occurred. If this continues, please reach out to your administrator."

I resolved the issue by changing the range to 1 to 10, and updating the template to var priority = double.Parse(node.HasValue("searchEngineRelativePriority") ? node.Value<string>("searchEngineRelativePriority") : "5")/10;

sofietoft commented 1 week ago

Thanks for reporting this @carlhope 💪

We'll look into the guide, to determine whether we're talking about a bug or faulty docs.