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

Umbraco.slider initial value is always 0 #3855

Closed
Deltids opened this issue Dec 11, 2018 · 7 comments
Closed

Umbraco.slider initial value is always 0 #3855

Deltids opened this issue Dec 11, 2018 · 7 comments

Comments

@Deltids
Copy link

Deltids commented Dec 11, 2018

Reproduction

Bug summary

The initial value of the slider is 0 even though the UI shows a positive number and initial value setting is set to a positive number .

Orientation: Horizontal
Initial value: 15
Minimum value: 1
Maximum value: 30
Precision: 0
Tooltip: show

When I debug the application the property is initally set to 0.
If I go into the backoffice and change the slider to e.g. 14 and save and publish, it works, but up until that point its value is 0.

There is nothing in our application that interfer with this property in any way, so it looks to me as a bug in umbraco somewhere.

Specifics

This is umbraco 7.12.3

Steps to reproduce

  • Create a Document Type with a slider property.
  • Get the document content in a custom controller
    var myDocType = content.Children.OfType<MyDocType>.FirstOrDefault()
  • Check the slider value on first page load MyDocType or saving it to a variable:
    sliderCnt = Convert.ToInt32(myDocType?.sliderCntProperty);

Expected result

Expected result is that the initial value of the slider value is initial value defined in settings.

Actual result

The value is 0

@nul800sebastiaan
Copy link
Member

Hmm, unfortunately I can't reproduce in 7.12.3. Any javascript errors maybe?
If you have any more details then feel free to re-open the issue!

3855

@nul800sebastiaan
Copy link
Member

Ah, I just noticed the code you added above. Please note that the slider value will not be in the published content until you publish the document. So if you add a slider property the contact page of your site you need to go into the contact page and publish that page with the default value, otherwise the default value will just be the default value of int, which is 0.

@Deltids
Copy link
Author

Deltids commented Dec 13, 2018

So every time the site gets re-deployed, I have to manually go to the page and "Save and publish"? The page is in published state in the backoffice, and the slider shows 15 (though, slightly off)

image

image

@nul800sebastiaan
Copy link
Member

I'm not sure what re-deploying has to do with it but I encourage you to try to get some help on the forums as the functionality works as expected.

@Deltids
Copy link
Author

Deltids commented Dec 13, 2018

Ok, I'll try.

It will still be my understanding that it is not working as expected, as the page with the slider is published, but the value is not available in published content. I would understand if the page status was unpublished.

Thanks for the answers.

@nul800sebastiaan
Copy link
Member

That's the part I can't reproduce though, if I publish the value then it's available in published content as expected.

@claushingebjerg
Copy link

claushingebjerg commented Sep 23, 2021

This is still a problem in 8.14 (the site im working on.)

If the initial value is untouched by the editor it returns 0.
I use the slider for defining padding. The bottom row has a initial value of 3 set - it renders 0.
The top row has an initial value of 3 set, which has been moved to another value and back to 3 and saved. it returns 3.

Skærmbillede 2021-09-23 kl  12 49 24
Skærmbillede 2021-09-23 kl  12 49 40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants