When only the case of a character in a SettingValue (SV) in the ModuleSettings table is changed, it will not properly update. This is because the check to see if the SV has updated is case insensitive.
The UpdateModuleSetting Stored Procedure compares the old SV with the new in the following section:
WHEN MATCHED AND IsNull(S.SettingValue, N'') != IsNull(Q.SV, N'') THEN -- update only, if value has been modified:
UPDATE SET [SettingValue] = Q.SV, [LastModifiedByUserID] = @UserID, [LastModifiedOnDate] = GetDate()
Due to the collation set on the SettingValue column in the ModuleSettings table, which is not Case Sensitive, the SV will not update if the new value is the same as the old but with the case of a character changed.
List the precise steps to reproduce the bug:
Module Setting Value does not update if only the case of a character has changed.
Any change to a Module Setting's value should be properly updated.
Two possible solutions that come to mind for this are:
Latin1_General_CS_AS during the comparison between old and new versions of the SettingValue.I am strictly against the first solution, as changing collation order on a column might affect sorting as well and cause side effects.
I'll check out the second option - which might need to be applied for update of other settings as well.
I would tend to agree with Sebastian on this, I think if any change it would need to be temporary for the SP.
But, I also question the need for it to be conditional at this level given that we have .NET Code that also makes it conditional.
I agree, first solution would be problematic for other areas. I would go with either the second option or handle that in code too.
I would tend to agree with Sebastian on this, I think if any change it would need to be temporary for the SP.
But, I also question the need for it to be conditional at this level given that we have .NET Code that also makes it conditional.
Right, why not just remove the check?
@sleupold , @valadas ?
I'll have a look and plan to provide a PR
Most helpful comment
I'll have a look and plan to provide a PR