Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.3

Bug #14427 Empty SQL-Result + Array_Merge
Submitted: 2008-07-31 10:20 UTC
From: vaneerd Assigned: doconnor
Status: Closed Package: Structures_DataGrid (version 0.9.0)
PHP Version: 5.2.5 OS: Independent
Roadmaps: (Not assigned)    
Subscription  


 [2008-07-31 10:20 UTC] vaneerd (Florian Van Eerd)
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(); }

Comments

 [2011-12-26 22:58 UTC] doconnor (Daniel O'Connor)
I see what you mean, but really the datasource should never return a non array for use in this funciton, IMO.
 [2011-12-26 23:00 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Should be fixed now