When updating template “__Standard Values”, I got issue not be able to update unchecked checkbox, unselected droplink/droplist, even empty single-line text box through TDS update package. After checking the synced serialized item in TDS project, it showed the fields were empty value with content-length 0. When using Sitecore Update wizard to process the package generated by TDS project, it actually ignored these fields.
Based on Sitecore’s explanation, not all Sitecore templates have Standard values(SV) by default and customers/partners often create ones themselves. As a result, In the case where we introduce a SV in a new update and the solution had an existing SV, we need to handle this correctly, customer data in SV item should be preserved. Thus Sitecore development team made a decision to introduce edge case logic here: If the update is adding SV and the item already exists in the solution, the field values are merged to maintain the customer/partners data and changes(e.g. if the value in the package is empty, the data in the field will be left without changes). So this is the expected outcome for standard values with the update wizard.
This is a weird situation. That means the template Standard Values update through Sitecore UI may not be synced to other upper/lower environments by TDS update package which is generated from source code build.
Then what’s the solution? when playing with the serialized item in source, I found if I removed the empty value field from serialized item file, for example, deleting the field below which unchecked “Enable item fallback” checkbox, it was then processed by Update wizard correctly.
But we can’t rely on manual deleting fields from source file in an automated DevOps process. Then I found an alternative solution: use Sitecore field Reset function instead of regular content UI when such as:
- un-checking Checkbox,
- deselecting Droplink
- deselecting Droplist,
- empty Single-line Text box
- empty Rich Text box
This applies to almost all the field types. It is kind like Reset to original value. Here is how:
- Highlight the “__Standard Values” item, click the “Reset” button under menu “VERSIONS”
- In the reset form, left side is current value, right side is the value will be reset to.
After save the reset results, then sync the Sitecore “__Standard Values” item to TDS project as normal. They will be actually removed from serialized item in source, then processed properly in Update Wizard.