Problem with searching TINYINT(1) fields

In a project I’m working on, users have four TINYINT(1) fields in their database table, which are flags for login enabled and user role types.

Login enabled has a default of ‘1’, and the rest have a default of ‘0’.

If I leave those fields searchable in the Yii admin section, the only entries that show up are ones that have all flags equal to the default (set by the database) values. As soon as one of those flags is changed to something besides its default, the search stops returning it.

This seems like a bug to me - the problem goes away as soon as I remove those fields from the search criteria, but I need to be searching them. Is this actually a bug?

In the controller -> actionAdmin() after the line


$model=new yourmodel('search');

set all property that have default values to ""

like




$model->loged="";

$model->role1="";