Developer forum

Forum » Development » BeforeCustomFieldValueIsChanged not hit for checkboxes

BeforeCustomFieldValueIsChanged not hit for checkboxes

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

We see that the notification subscriber: BeforeCustomFieldValueIsChanged (and BeforeCustomFieldValueIsSet etc.) is not fired for checkboxes.

Please find this code in SetPostValues:

                Dim valueChanged As Boolean = value <> Converter.ToString(orderFieldValue.Value)
                If fieldType.Equals("checkbox", StringComparison.Ordinal) Then
                    valueChanged = Converter.ToBoolean(orderFieldValue.Value) = (value <> "")
                ElseIf fieldType.Equals("date", StringComparison.Ordinal) OrElse fieldType.Equals("datetime", StringComparison.Ordinal) Then
                    Dim prevVal As Date = Converter.ToDateTime(orderFieldValue.Value)
                    Dim nextVal As Date = Converter.ToDateTime(value)
                    valueChanged = orderFieldValue.Value Is Nothing OrElse Not Date.Equals(prevVal, nextVal)
                End If

This line: Converter.ToBoolean(orderFieldValue.Value) = (value <> "") gives us a issue, as a "true" in value is not equal to "", then this expression (value <> "") evaluates to "true". But then a previous "false" value in orderFieldValue.Value makes this expression false: Converter.ToBoolean(orderFieldValue.Value) = (value <> ""), but it should be true.

 

I hope it can be fixed?

 

Best regards, Anders


Replies

 
Nicolai Pedersen
Reply

Of course it can.

I will send to a dev for verification and fixing!

BR Nicolai

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Did you have time to look into this issue?

 

Best regards, Anders

 
Nicolai Pedersen
Reply

TFS#88577 - fixed in 9.10

 

You must be logged in to post in the forum