Home » Database » DB_DataObject_FormBuilder » Bug #5214
BLOB types do not generate TextAreas
Details
| Request #5214 | BLOB types do not generate TextAreas |
|---|---|
| Submitted | 2005-08-26 17:30 UTC |
| From | mfischer at php dot net |
| Assigned | justinpatrin |
| Status | Closed |
| Package | DB_DataObject_FormBuilder |
| PHP Version | Irrelevant |
| OS | Unix |
| Roadmaps | (Not assigned) |
Comments
[2005-08-26 17:30 UTC] mfischer at php dot net
Description:
------------
When creating a form from a DO which has columns of type "text" only a <input type="text"> is displayed instead of a textarea.
I tracked down that in FormBuilder.php in _generateForm() in the big switch statement is the case:
case ($type & DB_DATAOBJECT_STR):
Inside it only calls _createTextArea if the string contains newlines:
// If field content contains linebreaks, make textarea - otherwise, standard textbox
if (isset($this->_do->$key) && strlen($this->_do->$key) && strstr($this->_do->$key, "\n")) {
$element =& $this->_form->_createTextArea($key);
When we use this form for insert a new element, there's no value and thus there's always a TextField displayed instead of a TextArea.
This can be fixed by additionally verifying for type DB_DATAOBJECT_BLOB. If, like in our case, the mysql type is set to 'text' then the DB_DATAOBJECT_BLOB bit is also set.