U4-2996 - Possible wrong behavior in MVC/Razor when using Danish culture (and probably others)

Created by Anders Bjerner 30 Sep 2013, 16:58:20 Updated by Shannon Deminick 21 Jun 2017, 07:58:15

I'm not sure whether this is a bug or expected behavior, but it has given me quite some headaches.

I have a document type with a "textstring" property (lets call it "MyStringValue" for now) storing a list of node IDs separated by commas. Calling Model.MyStringValue in a Razor macro, the return type is a string in most cases. However when the value is eg. "1,2", the return type is a decimal when using a Danish locale (which uses a comma for decimal separator), but a string when using an English locale.

On the other hand, if the property has a value of "1.2", the return type will be a decimal when using an English locale, but a string when using a Danish locale.

I think the different behavior for different locales is a problem, since you're not sure what return type to get. Also I would assume that the "textstring" data type is for storing, and the return type therefore always a string.


Shannon Deminick 21 Jun 2017, 07:58:15

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/

Priority: Normal

Type: Bug

State: Closed


Difficulty: Normal

Category: Localization

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.1.0, 6.1.5, 6.1.6

Due in version:


Story Points: