1

Using Sitecore 10.1 with commerce.

I see this Invariant language for some of the items. Here is a snap of a template's standard values (Regular custom Sitecore template) and all the items created from this template have it.

enter image description here Performed the following steps with no luck:

  1. Delete items with no language
DELETE FROM [VersionedFields] WHERE [Language] IN ('','hy-AM')  
DELETE FROM [UnversionedFields] WHERE [Language] IN ('','hy-AM')
  1. Run the Sync Content Path command as this is a commerce instance.

enter image description here

  1. Deleted all languages under system node except english.

  2. Indexed master & web databases

9
  • Is this happening on commerce specific templates? Jul 1, 2021 at 11:53
  • @GauravAgarwal This is for regular Sitecore templates
    – sukesh
    Jul 1, 2021 at 12:37
  • @Qwerty if you run the following queries on the master database: SELECT * FROM [VersionedFields] WHERE [Language] = '' and SELECT * FROM [UnversionedFields] WHERE [Language] = '', what is the count? Jul 1, 2021 at 12:50
  • @HishaamNamooya There are no records for either queries
    – sukesh
    Jul 1, 2021 at 12:52
  • The template which is having the Invariant Language issue, have you created it on the Sitecore instance or has it been installed? If it is installed, check on the environment where the package was created to see if there also it is as Invariant language Jul 1, 2021 at 13:13

1 Answer 1

8
+25

You could do this with Unicorn (it will not fail, even with these rogue invariant item versions) but you can also achieve it with the built-in developer tools.

Before you do, set your default system serialization format to YAML. By default you can set this in App_Config\Sitecore\CMS.Core\Sitecore.Serialization.config.

Go to your Developer ribbon, Serialize the item in question.

Serialize Item

Now go to your App_Data/serialization folder and find the file in question.

In the YAML file you will find something like this:

- Language: 
  Versions:
  - Version: 1
    Fields:
    - ID: "25bed78c-4957-4165-998a-ca1b52f67497"
      Hint: __Created
      Value: 20210630T100059Z
    - ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
      Hint: __Created by
      Value: |
        sitecore\Admin
- Language: en
  Versions:
  - Version: 1
    Fields:
    - ID: "25bed78c-4957-4165-998a-ca1b52f67497"
      Hint: __Created
      Value: 20210708T093402Z
    - ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
      Hint: __Created by
      Value: |
        sitecore\Anonymous

Notice the first one has no language specification, it reads Language: .

Delete this rogue version and save the file.

Now go back to your ribbon, and select "Revert Item".

This should clear it up for you.

Revert Item

Also note that you are likely to run into this problem again, as this is a known bug in SXA. You can find some details in this blog post: Sitecore SXA/JSS – Invariant language versions and access denied exceptions

Update, the SQL way

I also strongly believe you did not try out the comment from Hishaam above. When you have "Invariant Language" showing up in your Content Editor, there most definitely will be entries in your VersionedFields table that shows it. You could get rid of them by executing a SQL statement on both your Master and Web databases.

SQL Management Studio

  • DELETE FROM [Sitecore.Master].[dbo].[VersionedFields] WHERE [Language] = ''
  • DELETE FROM [Sitecore.Web].[dbo].[VersionedFields] WHERE [Language] = ''

Don't forget to completely reset IIS after making changes on SQL level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.