SitecoreUnicorn / Unicorn

A Sitecore utility designed to simplify deployment of Sitecore items across environments automatically
MIT License
269 stars 116 forks source link

Making field shared AND resetting to Standard Values in one go not working #365

Closed zaheer-tariq closed 5 years ago

zaheer-tariq commented 5 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? We are not allowed to reset values to standard for the given item.

If the current behavior is a bug, please provide the steps to reproduce. 1) Create a template and a (Multilist) versioned field. Set some standard values on this field. 2) Create and item based on the above template and change the values so that the item has its own values and NOT the ones coming from standard values. 3) Roll out this change on another environment via Unicorn. 4) Now change the (Multilist) versioned field to SHARED. 5) Go the item created in step 2 and try resetting field values to standard values. You will notice that it does now allow you to do that and keeps resetting values to the ones previously selected on this item instead of the standard values. 6) Remove item's langauge version and then add the version again. You will see that the field is now reset to standard values. Serialize the item and you will notice the the yml file is correct i.e. the field is now shared and have values coming from standard. 7) If you try to roll out this change to another environment, unicorn will give you this error 344 22:46:19 ERROR [Dilithium] Data corruption in master://{c942a824-01fd-4a63-b5d4-b9e114a78c79}! Field {2909229b-ebee-44f4-bba4-0792d012b39b} (shared) had a value in the versioned fields table. The field value will be ignored.

What is the expected behavior? It should be possible to change a versioned field to shared and also reset the item based on it to standard values in one go.

Please mention your Sitecore version and Unicorn version. Sitecore: 9.0.2 Unicorn: 4.0.8

cassidydotdk commented 5 years ago

Which version of Rainbow?

Latest releases fix lots of issues related to shared/versioned field handling - e.g. https://github.com/SitecoreUnicorn/Unicorn/issues/334

I recommend, first of all, to get on to the latest version of both Unicorn and Rainbow and try again.

zaheer-tariq commented 5 years ago

Hi,

I have updated both Unicorn and Rainbow to the latest version and tested again. The behavior is exactly the same except Point 5, where in the Sitecore instance where I changed the field to Shared, I am now allowed to reset the field values probably because changing the field to shared have removed data from VersionedFields table.

Once you roll out the change like mentioned in Point 7 to another Sitecore instance/environment you will get the same error.

cassidydotdk commented 5 years ago

Ok. Which version of Sitecore are you on?

cassidydotdk commented 5 years ago

I've been able to reproduce the issue on Sitecore 9.2, but only when Transparent Sync is enabled.

Please share the configuration file in question.

zaheer-tariq commented 5 years ago

Sitecore: 9.0.2

I have attached the config file. enableTransparentSync is set to false

Unicorn.config.txt

cassidydotdk commented 5 years ago

... this is the default config that Unicorn ships with. Do you not think it would be YOUR specific configuration file I would be after? :P

zaheer-tariq commented 5 years ago

Its the one we are using right now. I double checked and can confirm that we are not overriding enableTransparentSync via any patch file either.

zaheer-tariq commented 5 years ago

Sorry for the confusion. Below are the serialization config files I am using

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <unicorn>
            <configurations>
                <configuration name="Foundation.Abc" description="Foundation Abc" dependencies="Foundation.Serialization" extends="Helix.FoundationManagedModule" >
                    <predicate>
                        <include name="Layouts" database="master" path="/sitecore/layout/Layouts/$(layer)/$(module)" />
                        <include name="Renderings" database="master" path="/sitecore/layout/renderings/$(layer)/$(module)" />
                        <include name="PlaceholderSettings" database="master" path="/sitecore/layout/Placeholder Settings/$(layer)/$(module)" />
                    </predicate>
                    <predicate>
                        <include name="SystemViewRendering" database="master" path="/sitecore/templates/System/Layout/Renderings/View rendering">
                            <exclude children="true" />
                        </include>
                        <include name="SystemControllerRendering" database="master" path="/sitecore/templates/System/Layout/Renderings/Controller rendering">
                            <exclude children="true" />
                        </include>
                    </predicate>
                </configuration>
            </configurations>
        </unicorn>
    </sitecore>
</configuration>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <unicorn>
            <configurations>
                <configuration name="Project.Standard" description="Project.Standard content" dependencies="Foundation.*,Feature.*,Project.Common" extends="Helix.Project">
                    <predicate>
                        <include name="Content" database="master" path="/sitecore/content/Standard" />
                    </predicate>
                </configuration>
            </configurations>
        </unicorn>
    </sitecore>
</configuration>
cassidydotdk commented 5 years ago

There are no templates in either config posted here; so this can't be the configs that reproduce the problem.

I've closed this issue because there's just too much noise here for it to be useful. I've found a problem with resetting field values when Transparent Sync is enabled, I will open a new issue focusing on that.

If you can produce a step by step guide with matching configuration files that demonstrate this problem WITHOUT transparent sync, feel free to update here for investigation.