Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in Shared and Unversioned Fields causing data loss in Standard value #409

Open
sitecorejp opened this issue Mar 31, 2021 · 0 comments

Comments

@sitecorejp
Copy link

sitecorejp commented Mar 31, 2021

Do you want to request a feature or report a bug?
Yes if possible.

What is the current behavior?
After changing Shared and Unversioned Fields then run unicorn sync the value on Standard value will got lost.

What is the expected behavior?
No data lose.

Please mention your Sitecore version and Unicorn version.
SC92 revision 002893
Unicorn V4.1.1,

If the current behavior is a bug, please provide the steps to reproduce.

1, I have the following template
image

2, It has one Checkbox field
image

3, yml files:
image

4, Is Searchable setting
image

5, Is Searchable.yml
image

6, Is Searchable on Standard Values
image

7, __Standard Values.yml
image

8, Uncheck Shared, Unversioned on Is Searchable
image

9, Is Searchable.yml changed accordingly as expected
image

10, There is no change to Is Searchable on Standard Values as expected.
image

11, There is no change to __Standard Values.yml as expected
image

12, Run /unicorn.aspx sync then go back to Is Searchable on Standard Values and it been unchecked
image

13,Manually check Is Searchable
image

14,__Standard Values.yml changed as expected and Is Searchable field has been added UNDER the versions.
image

Summary:
As showing in step no.8 that after changing a template field from shared/unversioned to unshared/versioned,
It will cause data lose on the standard value after unicorn sync.

The reason because in step no.8, after uncheck Shared, Unversioned on Is Searchable, the Is Searchable
No longer a shared field.

In step no.12 during the unicorn sync, __Standard Values.yml will be used and as Is Searchable no longer a shared
and it does not have value set under the versions that unicorn will uncheck it. THIS IS CAUSING DATA LOSE.
As you can see in step no.13 and no.14, when manually check the Is Searchable, the field will be added under the versions.

I would expected unicorn to handle when there is a change of the Shared, Unversioned fields, on standard value item, add
additional check which could create an initial value of the field value under the versions per language.

I tested sitecore default serialization which won't have this behavior as the yml format are different.

 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant