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

DefaultDeserializer resets fields which are excluded in fieldFilter #30

Closed
NaibafCH opened this issue Mar 27, 2019 · 5 comments
Closed
Labels

Comments

@NaibafCH
Copy link
Contributor

NaibafCH commented Mar 27, 2019

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

Unknown

What is the current behavior?

I've excluded the Sitecore field "__Security" in the <fieldFilter> element of my Unicorn configuration. However, the field still gets reset during Sync when other fields of the same item have changed. This behaviour is somewhat described here, but it also states that the field should be "effectilvely ignored", which it is not. Therefore I'm not sure if this is a bug...

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

  • Exclude a field in the <fieldFilter> element of your configuration (e.g. __Security)
  • Change any value in another field in one of the serialized items. This way, the excluded field should be removed from the serialized item's file.
  • Deserialize

What is the expected behavior?

Since I've excluded the field from Unicorn, I would expect this field to be completely ignored during serialization and deserialization.
I've added the necessary changes to the DefaultDeserializer including a unit test which illustrates this behaviour here: NaibafCH@9e6a352

Please mention your Sitecore version, Rainbow version, and if also using Unicorn, your version of that too.

Sitecore: 9.0 Update-2
Rainbow: 2.0.0
Unicorn: 4.0.3

NaibafCH added a commit to NaibafCH/Rainbow that referenced this issue Mar 27, 2019
@cassidydotdk
Copy link
Member

Have you verified this behaviour against 2.0.6-pre6? Quite a number of fixes related to field handling and field resetting since 2.0.0 was released.

@NaibafCH
Copy link
Contributor Author

I've updated Rainbow to 2.0.6-pre6 in my Sitecore instance. Unfortunately, the behaviour is still the same. I also merged the develop branch into my own branch and tested the behaviour there.

@cassidydotdk
Copy link
Member

cassidydotdk commented Mar 27, 2019

Can you PR this? :-) To the develop branch.

@cassidydotdk
Copy link
Member

Fixed by the PR. Bug has been around for "quite a while", but since the default filter concerns fields that no-one really cares (much) about, it has gone unnoticed. Thanks for the PR :-)

@cassidydotdk
Copy link
Member

https://github.com/SitecoreUnicorn/Rainbow/releases/tag/2.0.6-pre7

cassidydotdk added a commit that referenced this issue Mar 28, 2019
* Small change to what triggers a Sitecore field value to be reset (to std value). Rainbow would skip this, for fields that already were .NullOrEmpty - but an unchecked checkbox field is empty and a reset one is null. Now it resets correctly for any value not null.

* Added constructor overload to the DefaultDeserializer, to remain compatible with SideKick and other potential projects that have not yet been updated.

* The ItemComparer will no longer attempt to find a Field Comparer for null/null values, it will now assume them to be identical. This should help untangle Unicorn Issue 319.

* 2.0.6-pre3

* Fixes Unicorn Issue #334 - Changes in Sitecore's internal handling of shared/versioned/unversioned field values conflicted with Rainbow's handling of same

* Ticked version to 2.0.6-pre4

* Another fix for Unicorn Issue #319 - Empty field values would not get written back to Sitecore if no field value existed (e.g. field contained standard value)

* Ticked version to 2.0.6-pre5

* Fixes Unicorn issue #324

* Ticked version to 2.0.6-pre6

* #30 - Do not reset fields which are excluded in the fieldFilter (#31)

* Changed 2 tests related to what should happen, when a field is in target only or source only

* Fixed some line endings to deal with some LF/CRLF inconsistency. We probably need a .gitsettings to nail this down

* Ticked version to 2.0.6-pre7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants