question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v8: PublishedContentExtensions.Value helper returns no value for invariant property when culture is passed in

See original GitHub issue

When calling model.Value("propAlias", culture:"en-US") on a property where the given property is culture invariant, no value is returned.

I think there should be one of two things possible here

  1. Either return the invariant value for any passed in culture, as, being invariant means that value is what should be displayed for all languages

or

  1. Provide a fallback option that allows you to fallback to the invariant value if the property you have asked for is invariant but you try to access it via a culture variant means

The reason I require this is because I have some code that needs to try and access properties in a generic way. The code is passed a culture and property aliases, but it is not aware if any of the properties are culture specific and so there should be a way to access properties in a single generic way without having to know up front whether it is language variant or invariant. Currently, the only way to achieve this is to try and access the value passing the culture, but if the value is empty, try again this time with no culture.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nul800sebastiaancommented, Sep 30, 2019

Yeah, that sounds good to me, we’ll have a chat at HQ and will let you know!

Personally I think it would be nicest to have a boolean on the property to see if it’s invariant or not, it seems easier to discover.

0reactions
umbrabotcommented, Mar 4, 2021

Hiya @mattbrailsford,

Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more.

We will close this issue for now but we’re happy to open it up again if you think it’s still relevant (for example: it’s a feature request that’s not yet implemented, or it’s a bug that’s not yet been fixed).

To open it this issue up again, you can write @umbrabot still relevant in a new comment as the first line. It would be super helpful for us if on the next line you could let us know why you think it’s still relevant.

For example:

@umbrabot still relevant This bug can still be reproduced in version x.y.z

This will reopen the issue in the next few hours.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

CultureInfo.InvariantCulture Property (System.Globalization)
This technique ensures that the underlying date and time values do not change when the data is read or written by users from...
Read more >
Class PublishedContentWrapped | Umbraco c# Api docs
Remarks. Contains one IPublishedProperty for each property defined for the content type, including inherited properties. Some properties may have no value.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found