Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

ORM Validation skip blank email values

posted by plankton 8 years ago
        fORMColumn::configureEmailColumn($this, 'email');

...

        $user->setEmail("");
        $user->store();

No exception is thrown but I think it should be.

Maybe it would be better to change the code below in ORMValidaton (780-783) ?

if (!strlen($values[$column])) {
				continue;
			}

If you make your field NOT NULL in the database, it will be required. If I changed fORMValidation, it would not be possible to have an optional email field.

posted by wbond 8 years ago

Hmm.. But it is set to NOT NULL. I even tried to set it with fORMValidation::addRequiredRule($this, 'email');

No luck :(

PS. It works for other columns but not for a emailColumn type

posted by plankton 8 years ago

Does it have a default value?

posted by wbond 8 years ago

No. It does not.

posted by plankton 8 years ago

Alright, you win, it is a bug. However, the bug is fixed in r1021. :-)

posted by wbond 8 years ago

Great. Now it works like a charm. Thank you.

posted by plankton 8 years ago