Home » Structures » Structures_DataGrid » Bug #3607
Binding to null datasets causes fatal error
Details
| Submitted | 2005-02-26 16:20 UTC |
|---|---|
| From | nick at foobar dot org |
| Assigned | asnagy |
| Status | Closed |
| Package | Structures_DataGrid |
| PHP Version | 4.3.10 |
| OS | FreeBSD |
| Roadmaps | (Not assigned) |
Comments
[2005-02-26 16:20 UTC] nick at foobar dot org
Description:
------------
Using Structures::DataGrid 0.6.0 (and have tried 0.6.2)
Reproduce code:
---------------
<?php
require_once 'Structures/DataGrid.php';
$res =& $peardb->query('SELECT * FROM blahtable WHERE 1=0');
while ($record = $res->fetchRow()) {
$dataSet[] = $record;
}
$dg =& new Structures_DataGrid(20, 1);
$dg->bind($dataSet);
print $dg->renderer->toHTML();
?>
Expected result:
----------------
The code should fail gracefully with some form of recoverable error. Better still, there should be some way of specifying a callback for what should happen when a null data set is specified.
Actual result:
--------------
Fatal error: Call to a member function on a non-object in /usr/local/share/pear/Structures/DataGrid/DataSource/DataObject.php on line 206