validator:required bug?

Archived from the Xataface Users forum.

igormt — Tue Feb 21, 2012 6:27 pm

Hi,

Using the current svn for 1.3.x branch (revision 3338), when I try to set that a validator is not required for a field, the field suddenly becomes “mandatory”. The following example illustrates:

SQL:
CREATE TABLE test1 (
id int(11) NOT NULL AUTO_INCREMENT,
x int(11) DEFAULT NULL,
y int(11) DEFAULT NULL,
z int(11) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

test1/fields.ini:
[id]

[x]

[y]
validators:required=false

[z]

If you try to add a new record in Xataface for table test1, you’ll see a little red dot next to field “y” and if you leave it blank, you get an error message. The problem also occurs if you set validators:required to “false”, true, “true”, 0, 1, “0”, or “1”.

I believe this is a bug, but perhaps I am misunderstanding how this is supposed to work.

Thanks,

Igor


shannah — Wed Feb 22, 2012 12:29 pm

This is a bug.
http://bugs.weblite.ca/view.php?id=856
It has been fixed in SVN including 1.3.x branch so will be included in the next release. The bug report in the link includes the diff.

-Steve


igormt — Wed Feb 22, 2012 6:20 pm

Steve,

Thanks, but I *am* using the current 1.3.x svn branch, rev 3338. I confirmed that the diffs are included in the version I am using. Yet I still have the bug above.

So I don’t believe the bug is fixed.

Sorry,

Igor


shannah — Thu Feb 23, 2012 10:38 am

Should be fixed for real now in 1.3.x branch rev 3340. The diff can be found at
http://bugs.weblite.ca/view.php?id=856

-Steve


igormt — Thu Feb 23, 2012 7:05 pm

Steve,

I’ve updated to rev 3340 and I can confirm that all combinations of validator:required=true/false with fields that allow/don’t allow NULLs work correctly now.

Thanks so much.

Igor