Try our conversational search powered by Generative AI!

schedule job setting language

Vote:
 

Hi

I'm running episerver cms 9 and have a Scheduled Job in my website. 

When then job is made to run (manually or using a time schedule) the current culture becomes english. I have tried changing that programmatically using e.g.

Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK", false);

contentRepository.GetDefault(...., CultureInfo.CurrentCulture)


 

or this code 

contentRepository.GetDefault(...., new CultureInfo("da-DK"))



 But both gives me an error saying: 

{"netContentCreateLanguage: LanguageBranchID is null, possibly empty table tblLanguageBranch"}

#164416
Oct 24, 2016 19:20
Vote:
 

Enabled the language in admin/edit mode? Also remember access rights of course if running the job automagically :)

Are there pages with that culture already?

Maybe some small typo with culture string? Tried small chars?

#165544
Oct 25, 2016 6:58
Vote:
 

The da language is already enabled. That is the default language.

The access right are giving dynamically using

{
PrincipalInfo.CurrentPrincipal = new GenericPrincipal(
new GenericIdentity("Scheduled TrafficInfoArchive"),
new[] { "Administrators" });
}

Alle the pages are with da culture, and the typo is correct. 

However the problem still exists.

#168817
Edited, Oct 25, 2016 12:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.