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

Bug #5300 Some PHP notices shows when an callback function is used for col formatting
Submitted: 2005-09-05 12:29 UTC
From: kick_tisho at yahoo dot com Assigned: asnagy
Status: Closed Package: Structures_DataGrid
PHP Version: 4.3.2 OS: Windows
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 40 + 40 = ?

 
 [2005-09-05 12:29 UTC] kick_tisho at yahoo dot com
Description: ------------ When am using an callback function for column formatting, without passing params, for example $dg->addColumn(new Structures_DataGrid_Column('Name', null, 'lname', array('width' => '40%'), null, 'printFullName()')); it gives me some PHP notices Notice: Undefined variable: in D:\Progra~1\php\pear\Structures\DataGrid\Column.php on line 183 As i find it usable to develop with PHP notices turned on, i think this small bug should be fixed.

Comments

 [2005-09-06 03:12 UTC] stoyan
I think the issue is in the formatter() method of the Structures_DataGrid_Column class. <?php // Build the list of parameters $length = strlen($this->formatter) - $size - 2; $parameters = substr($this->formatter, $size + 1, $length); $parameters = explode(',', $parameters); ?> Here the last line assumes parameters and if none are given $parameters becomes array([0] => '') Then there is a loop through $parameters. I think there should be a check in the loop for non-empty parameters, like <?php foreach ($parameters as $param) { if (empty($param)) { continue; } // ... the rest of the loop body ?>
 [2005-09-12 13:54 UTC] asnagy at php dot net
This bug has been fixed in CVS. 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.