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:
And it was set in the
I could happily create a new form via the shiny new form editor, and save it:
And the form would appear in the content tree:
But when you come back to the "choose a form to edit" view in the designer:
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:
So, what happens if we just add a version in the
en
language? Well pretty much instantly, we can see:
Success!
Now it's only the root item of the form which needs updating to make the form visible:
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:
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:
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...