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.
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.
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.
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.
SELECT * FROM [VersionedFields] WHERE [Language] = ''
andSELECT * FROM [UnversionedFields] WHERE [Language] = ''
, what is the count?