1

We are facing issue in loading the custom config file post 8.2 to 9.2 upgrade.

Context

We had upgraded our 8.2 instance to 9.2 instance. Before the upgrade, we had disabled our custom config files. Once the upgrade is completed , we enabled the custom config files.

Problem statement

There are 30 custom config files.(custom1.config to custom30.config) Each config file will have a key value pair inside the DataTemplateconstants node

While checking the custom config entries file in showconfig.aspx, we found the key value pairs are not loaded properly.

Only the entries in the first custom1.config is loaded.

Entries from the other files as custom2.config .. custom30.config files are not loaded

Sample structure of config files

Custom1.config file

 <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
      <sitecore>
        <DataTemplateConstants>
            Key  Value 1    
            Key  Value 2    
            .
            .
            .
            Key Value 50

        </DataTemplateConstants>
      </sitecore>
    </configuration>

Custom2.config file

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <DataTemplateConstants>
        Key  Value 1    
        Key  Value 2    
        .
        .
        .
        Key Value 30

    </DataTemplateConstants>
  </sitecore>
</configuration>

Custom3.config file

 <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
      <sitecore>
        <DataTemplateConstants>
            Key  Value 1    
            Key  Value 2    
            .
            .
            .
            Key Value 15

        </DataTemplateConstants>
      </sitecore>
    </configuration>
  • keys in all configs are same or different? and what is the folder location for your custom configs? – Mahendra Shekhawat Jun 9 '20 at 10:38
  • Keys in the config files are different. These config files are placed in Include folder. – PVM Jun 9 '20 at 11:46
  • Technically it should work but could you also share how you are creating nodes for the key-value? – Mahendra Shekhawat Jun 9 '20 at 12:42
  • Can you provide more details on how your configs are? – Hishaam Namooya Jun 9 '20 at 13:02
  • Node for creating the Key Value pair <FieldName Name="Name1" Value="Value1" /> <FieldName Name="Name2" Value="Value2" /> <FieldName Name="Name3" Value="Value3" /> – PVM Jun 9 '20 at 13:04
3

Following some testing on my local instance, I have been able to reproduce the issue. As you mentioned in the comment, it seems that the only values that are changed are the Name1 and Value1 etc...

The only way I have been able to fix it is to make the attributes Name and Value to be lowercase. Please see result below

custom1.config

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <test>
            <FieldName Name="Name4" Value="Value4" />
            <FieldName Name="Name5" Value="Value5" /> 
            <FieldName Name="Name6" Value="Value6" />   
        </test>
    </sitecore>
</configuration>

custom2.config

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <test>
            <FieldName Name="Name1" Value="Value1" />
            <FieldName Name="Name2" Value="Value2" /> 
            <FieldName Name="Name3" Value="Value3" />           
        </test>
    </sitecore>
</configuration>

Result

enter image description here

But if I write the attribute Name and Value as lowercase it works.

custom1.config

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <test>
            <FieldName name="Name4" value="Value4" />
            <FieldName name="Name5" value="Value5" /> 
            <FieldName name="Name6" value="Value6" />   
        </test>
    </sitecore>
</configuration>

custom2.config

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <test>
            <FieldName name="Name1" value="Value1" />
            <FieldName name="Name2" value="Value2" /> 
            <FieldName name="Name3" value="Value3" />           
        </test>
    </sitecore>
</configuration>

Result

enter image description here

Need to deep dive into the Sitecore Core functionality to see why the lowercase works compare to the other way. Need to see how Sitecore compiles the configuration files.

  • I am also facing Similar issue where only first config is getting loaded but not rest of them but I did not understand the solution as pictures of possible solution (Name & Value in lower case) are same as one causing issue. So what has to be lower case exactly – Alivor Tikos Jun 9 '20 at 16:26
  • @AlivorTikos instead of Name="Name1" Value="Value1", it should be name="Name1" value="Value1". It is the attribute that needs to be lowercase – Hishaam Namooya Jun 9 '20 at 16:32
  • @HishaamNamooya, Thanks it worked. It was working fine in 8.2 version. Was there any change in the 9.2 version. – PVM Jun 9 '20 at 18:05
  • I know that Sitecore had introduces the layers.config but maybe it is an issue internally when it is trying to patch the file. I’ll create a support ticket to see what does sitecore says. – Hishaam Namooya Jun 9 '20 at 18:08

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.