PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Structures » Structures_DataGrid » Bug #1584

Column formatter does not work due to a typo

Details

Submitted2004-06-08 23:09 UTC
Fromjackson at jaxn dot org
Assignedasnagy
StatusClosed
PackageStructures_DataGrid
PHP Version4.3.5
OSLinux (SuSE)
Roadmaps(Not assigned)

Comments

[2004-06-08 23: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=""]

[2004-06-25 14: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.