4

I have a unicorn configuration set up like this:

<include name="Rules" database="master" path="/sitecore/system/Settings/Rules" >
    <exclude children="true">
        <except name="Definitions" includeChildren="false" />
        <except name="Definitions/Elements" includeChildren="false" />
        <except name="Definitions/Tags" includeChildren="false" />
        <except name="Definitions/Elements/Error Page" includeChildren="true" />
        <except name="Definitions/Tags/Error Page" includeChildren="true" />
    </exclude>
</include>
<include name="Custom Rules" database="master" path="/sitecore/system/Settings/Rules/Definitions/Elements/Custom" includeChildren="true">
    <exclude path="Customer account type" />
</include>

When I run the synchronization process I get the following message:

The trees Rules and Custom Rules both contained the global path /sitecore/system/Settings/Rules/Definitions/Custom - overlapping trees are not allowed.

I am not expecting this as the first configuration should exclude all children, including the "Custom Rules" path so that it can be included in the second configuration. What is the correct way of achieving what I want to achieve?

3

In your setup I wouldn't serialize these items as they are OOTB:

  • <except name="Definitions" includeChildren="false" />
  • <except name="Definitions/Elements" includeChildren="false" />
  • <except name="Definitions/Tags" includeChildren="false" />

So instead of:

<include name="Rules" database="master" path="/sitecore/system/Settings/Rules" >
    <exclude children="true">
        <except name="Definitions" includeChildren="false" />
        <except name="Definitions/Elements" includeChildren="false" />
        <except name="Definitions/Tags" includeChildren="false" />
        <except name="Definitions/Elements/Error Page" includeChildren="true" />
        <except name="Definitions/Tags/Error Page" includeChildren="true" />
     </exclude>
 </include>
 <include name="Custom Rules" database="master" path="/sitecore/system/Settings/Rules/Definitions/Elements/Custom" includeChildren="true">
     <exclude path="Customer account type" />
 </include>

your setup should be just these 3 elements to be included:

<include name="Elements Error Page" database="master" path="/sitecore/system/Settings/Rules/Definitions/Elements/Error Page" includeChildren="true" />

<include name="Tags Error Page" database="master" path="/sitecore/system/Settings/Rules/Definitions/Tags/Error Page" includeChildren="true" />

<include name="Custom Rules" database="master" path="/sitecore/system/Settings/Rules/Definitions/Elements/Custom" includeChildren="true">
    <exclude path="Customer account type" />
</include>

Don't you have Customer account type specified in another config file by any chance? Could be that this is causing the trouble with overlapping trees as its excluded in your custom rule definition a could be it's specified somewhere else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.