Edit report at https://pear.php.net/bugs/bug.php?id=14427&edit=1
ID: 14427
Updated by: [email protected]
Reported By: vaneerd at gmail dot com
Summary: Empty SQL-Result + Array_Merge
Status: Open
Type: Bug
Package: Structures_DataGrid
Operating System: Independent
Package Version: 0.9.0
PHP Version: 5.2.5
Roadmap Versions:
New Comment:
I see what you mean, but really the datasource should never return a non
array for
use in this funciton, IMO.
Previous Comments:
------------------------------------------------------------------------
[2008-07-31 06:20:24] vaneerd
Description:
------------
I use Structures_DataGrid with Structures_DataGrid_DataSource_DB(Query)
& Structures_DataGrid_Renderer_HTML_Table.
When the query provided in
$datagrid->bind($sql, $options);
returns no rows (because no rows matching the criteria where found)
there is an error on line 870 in Structures/DataGrid/Renderer.php
The function array_merge($this->_records, $chunk); leads to an error, as
$chunk is not an array!
My solution was to simply add
if (!is_array($chunk))
{
$chunk = array();
}
------------------------------------------------------------------------