fixes #5820 Error in console when enable the mandatory field