Developer forum

Forum » Development » Change of case sensitivity between 9.15

Change of case sensitivity between 9.15

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a template running on 9.15 that read some parameters of the NavigationTreeViewModel.

The code looks like this in 9.14 (and it works):

string theme = !string.IsNullOrEmpty(Model.Parameters["Theme"].ToString()) ? Model.Parameters["Theme"].ToString() : string.Empty;

In 9.15, the same code returns an error and I had to change it to this:

string theme = !string.IsNullOrEmpty(Model.Parameters["theme"].ToString()) ? Model.Parameters["theme"].ToString() : string.Empty;

When I check the Model, I get this output for Parameters:

"Parameters": {
        "Layout": "linksOnly",
        "LinkFontSize": "fs-6",
        "mx-n3": "mx-n3",
        "navOrientation": "flex-row",
        "LinkFontWeight": "fw-normal",
        "navAlignment": "justify-content-start text-start",
        "LinkCasing": "",
        "theme": " theme no-theme",
        "ShowOnlyFirstNavLevel": false
    }

It looks like 9.14.0 was not case sensitive while 9.15.7 is case sensitive.

This means that any code I have in 9.14 will fail when upgrading

Am I missing something here? Could there be a hosting issue?

Thank you,

Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Parameters is a Dictionary<string, object> - which has not changed for years in DW. And it has always been case sensitive in .net by default.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I am sorry, it was my confusion. I discovered that the definition and the usage were in separate templates and the casing was inconsistent. Initially, I thought that the definition was included in the compiled code.

Thank you,

Adrian

 

 

You must be logged in to post in the forum