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

Bug #1584 Column formatter does not work due to a typo
Submitted: 2004-06-08 18:09 UTC Modified: 2006-12-26 22:31 UTC
From: jackson at jaxn dot org Assigned: asnagy
Status: Closed Package: Structures_DataGrid
PHP Version: 4.3.5 OS: Linux (SuSE)
Roadmaps: (Not assigned)    
Subscription  


 [2004-06-08 18:09 UTC] jackson at jaxn dot org
Description: ------------ Using the formatter in Structures_DataGrid_Column results in the following error: [pear_error: message="Unable to process formatter" code=0 mode=return level=notice prefix="" info=""] It can be fixed with the following .diff (just fixes a typo). --- ../../../usr/share/php/Structures/DataGrid/Column.php 2004-06-08 18:10:24.311603488 -0500 +++ ../Code/Column.php 2004-06-08 18:11:21.624890544 -0500 @@ -175,18 +175,24 @@ $vars = split('=', $param); $paramList[$vars[0]] = $vars[1]; } else { - $paramList[$param] = $result; + $paramList[$param] = $record; } } } else { $formatter = $this->formatter; $paramList = null; } + + // allow for OOP callbacks + if (strstr($formatter,'->')) { + $formatter = explode('->',$formatter); + } // Call the formatter if (is_callable($formatter)) { $result = call_user_func_array($formatter, $paramList); } else { + print_r($formatter); $result = new PEAR_Error('Unable to process formatter'); } Reproduce code: --------------- $column = new Structures_DataGrid_Column('Edit', null, null, array('align' => 'center'), null, null, 'cepUserList::printLinkClass())'); Expected result: ---------------- <a href="http://example.com/edit.php">Edit</a> Actual result: -------------- [pear_error: message="Unable to process formatter" code=0 mode=return level=notice prefix="" info=""]

Comments

 [2004-06-25 09:36 UTC] asnagy at webitecture dot org
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.