Try our conversational search powered by Generative AI!

Episerver Product Issue - DefaultContentLanguageSettingsHandler.GetContentLanguageSetting method

Fixed in

EPiServer.CMS.Core 11.18.0

(Or a related package)

Created

Apr 29, 2020

Updated

Aug 11, 2020

Area

CMS Core

State

Closed, Fixed and tested


Description

Hi Support,

I have a product issue to report that exists in the DefaultContentLanguageSettingsHandler.GetContentLanguageSetting method. This is being identified using the Briscoe client.

The current method uses a local within a lambda and this causes a function to be allocated for every execution and, given the hit count of this method, that’s a lot of memory (just a little shy of 1GB within 130 seconds).

So, in this particular case it’s better to iterate through the enumerable.

private static ContentLanguageSetting GetContentLanguageSetting(IEnumerable<ContentLanguageSetting> languageSettings, string languageBranch)

{

foreach (var languageSetting in languageSettings)

{

if (string.Equals(languageSetting.LanguageBranch, languageBranch, StringComparison.OrdinalIgnoreCase))

{ return languageSetting; }

}

return null;

}

The above code is the fix.

* Please see Zendesk Support tab for further comments and attachments.

Note for QA: To verify this we should make sure LanguageSettings (fallback/replacement) still work work as previously.