Jeremy Davis
Jeremy Davis
Sitecore, C# and web development
Article printed from: https://blog.jermdavis.dev/posts/2018/the-language-of-your-sitecore-forms-is-more-important-than-you-thought

The language of your Sitecore Forms is more important than you thought

Published 25 June 2018

Every so often I run up against an issue that's right there in the docs, but somehow has passed me by. This week that issue was Sitecore's new V9 forms implementation, and it's relationship with languages...

Edited to add: Sitecore seem to have managed to push out a fix for this in the time between me starting to write this and publishing it... If you deploy v9.0 Update 2 this should be resolved, according to the release notes. But I'll post this anyway because not everyone will upgrade right away...

If you're working in a situation where your default content language isn't en, and you try to create a new Sitecore form, you may get a bit confused. I was creating forms on a site where en-GB was the default:

Default Language

And it was set in the config:

SiteLanguageConfig

I could happily create a new form via the shiny new form editor, and save it:

Save New Form

And the form would appear in the content tree:

Form Is Created

But when you come back to the "choose a form to edit" view in the designer:

Form Is Missing

Where's it gone? Cue some head-scratching...

Now there are a few blog posts about that discuss the issue of forms not being visible when you try to return to them. But these weren't an issue in my specific case.

So digging a bit I noticed that even with the default language being en-GB for the site, the ajax requests that are being made to populate the "pick your form" UI are:

http://site/-/item/v1/sitecore/shell?search=&searchConfig=%7B60F35FD9-88CB-4DF5-8E78-1E9BF5FE181C%7D&sc_content=master&language=en&fields=__Created%7C__Updated%7C__Thumbnail&pageIndex=0&pageSize=25

					
http://site/-/item/v1/sitecore/shell?search=&searchConfig=%7BA7C51A03-028A-4414-98DF-116DFAEAE5A6%7D&sc_content=master&language=en&sorting=d__smallcreateddate&fields=__Created%7C__Created%20by%7C__Updated%7C__Updated%20by%7CClassification%7C__Thumbnail&pageIndex=0&pageSize=50

					

and

http://site/-/item/v1/sitecore/shell?sc_itemid=%7BAC27A304-1EED-487B-965E-C993C561C6A7%7D&sc_database=core&language=en

					

What's special about those? Well they all include the clause: language=en and we know (thanks to our default language) that our form items don't have a version in that language:

Actual Languages

So, what happens if we just add a version in the en language? Well pretty much instantly, we can see:

Form Appears

Success!

Now it's only the root item of the form which needs updating to make the form visible:

Root Form Item

If you actually want to have proper language variations of the form itself, you can use the form editing UI to decide which language you want to edit:

Form Language Choice

You don't need to manually create any of the other versions via Content Editor. But of course you need the form to be visible in the Forms editor in the first place to make that work...

Now, this issue is mentioned in Sitecore's documentation for the forms editor:

Forms Doc Mention

But if your default language is something other than en it's easier said than done to follow the instruction to "first save the form in the default language" – so until we get an update that fixes the choice of language for the UI's search queries, you may have to keep adding the en version of your form items manually...

↑ Back to top