U4-4190 - Unable to retrieve nodes language when no domain set

Created by Matt Brailsford 06 Feb 2014, 12:17:00 Updated by Daniel Bardi 25 Feb 2015, 08:41:41

Relates to: U4-4043

Relates to: U4-3753

The current method of retrieving a nodes language is to use Domain.GetDomainsById(int id)[0].Language. The problem is, if you don't define a domain when setting up the language, Umbraco creates a wildcard domain for you, which seem to be excluded by GetDomainsById() (GetDomainsById() calls GetDomains() which calls an internal method GetDomains(bool includeWildcard) with the includeWildcard param set to false).

There needs to be either access ALL domains, including wildcards, or there needs to be another way to get the languages.


Stephan 06 Feb 2014, 12:39:18

Good catch, will fix.

Stephan 05 Mar 2014, 07:24:46

While waiting for U4-4043 to be completed, I propose the following fix on the old API:

1/ Make Domain.GetDomains(bool includeWildcards) public so it becomes possible to get ''all'' domains, including the wildcard domains (that can be identified by their IsWildcard property).

2/ Add method Domain.GetDomainsById(int nodeId, bool includeWildcards) so it becomes possible to get ''all'' domains set on a given node, including the wildcard domain if any (that can be identified by its IsWildcard property).

If that seems OK I'll push today. Thoughts?

Matt Brailsford 05 Mar 2014, 08:51:40

Sounds like a fair interim fix to me.

Sebastiaan Janssen 18 Mar 2014, 11:14:52

@zpqrtbnk Did you ever push this fix?

Stephan 18 Mar 2014, 11:17:48

Sure that would be 83736be initially in 6.2 and later on merged into 7.1 by Shannon. Forgot to close the issue, but considering it fixed.

Sebastiaan Janssen 18 Mar 2014, 11:30:21


Daniel Bardi 25 Feb 2015, 04:20:46

Please fix this: http://issues.umbraco.org/issue/U4-3753

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.3

Due in version: 7.1.0


Story Points: