PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject_FormBuilder » Bug #6344

non-rendered boolean fields being overwritten by default

Details

Submitted2005-12-25 00:51 UTC
Froml dot nienhaus at gmail dot com
Assignedjustinpatrin
StatusClosed
PackageDB_DataObject_FormBuilder
PHP Version4.3.1
Roadmaps(Not assigned)

Comments

[2005-12-25 00:51 UTC] l dot nienhaus at gmail dot com

Description:
------------
Hi, I just encountered another issue with boolean fields:

I defined two fields of a table as being boolean, which so far works fine.
Somewhere else in my application I use the same DataObject / Formbuilder but with these two boolean fields not being rendered (but still being defined as boolean, using the booleanFields array).

But: actually it still gets written into the database with the default value of 0 (overwriting possible existing values) instead of being ignored, what in my eys should be the case, because the fields are not rendered.

Test script:
---------------
foreach ($this->booleanFields as $boolField) {
if (!isset($values[$boolField])) {
$this->_do->$boolField = 0;
}
}

Formbuilder.php, processForm() method

i think here it should be checked, whether a field is being rendered, before giving it a default value