PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Structures » Structures_DataGrid » Bug #3607

Binding to null datasets causes fatal error

Details

Submitted2005-02-26 16:20 UTC
Fromnick at foobar dot org
Assignedasnagy
StatusClosed
PackageStructures_DataGrid
PHP Version4.3.10
OSFreeBSD
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