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 » Structures » Structures_DataGrid » Bug #2128

Record_DataObject does not return an error when passed junk

Details

Submitted2004-08-15 15:06 UTC
Fromylf at xung dot org
Assignedasnagy
StatusClosed
PackageStructures_DataGrid
PHP Version4.3.4
OSLinux Debian (testing)
Roadmaps(Not assigned)

Comments

[2004-08-15 15:06 UTC] ylf at xung dot org

Description:
------------

In this constructor, you state :
$this->setRecord($data);

where data is the DataObject.

Then, the setRecord() method, in case the passed data is not a DataObject, triggers :

return new PEAR_Error('Invalid data type. ' .
'Data must be of type DB_DataObject');

But the constructor does not return this PEAR_Error object, it just calls setRecord(), and as a constructor, AFAIK it can't return anything but an instance of Record_DataObject.

I think the solution is to make the base Record class extend PEAR and then use $this->raiseError().

[2004-08-16 16:00 UTC] asnagy at webitecture dot org

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.