I have found a severe bug in version 9.11.016 of SC.
How to reproduce this bug.
-
Create a form application against an already populated table of the database that contains an integer column called F which is nullable
-
In the form app define F as nullable and define NULL as default value on Update and Insert in the database
-
Echo (print) the value of the field in these events: OnValidate, ,OnBeforeUpdate, and OnAfterUpdate
-
Run the form
-
Save the form leaving the field F as blank.
-
Observe the value of F in each event
-
OnValidate F=0, OnBeforeUpdate F is blank, OnAfterUpdate F is assigned the string null !!!
This is an inconsistent behaviour.
In previous version of SC the database was updated with NULL but the value of the field F in the OnAfterUpdate event was not assigned to the string null but left blank.
Becasue of this bug any PHP logic in the OnAfterUpdate event like:
if(empty(F)) then …
will not work because F is not empty , as it is assigned the lowercase string null.
Moroever an integer field cannot became a string in the OnAfterUpdate event !