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 #9992

orderBy=0 is lost in _parseHttpRequest()

Details

Submitted2007-01-31 19:27 UTC
Frommichael dot mauch at gmx dot de
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2007-01-31 19:27 UTC] michael dot mauch at gmx dot de

Description:
------------
Hi,

with DATAGRID_SOURCE_ARRAY, I can't sort for the first (zeroth) column, because orderBy=0 and _parseHttpRequest() has a line

if ($orderBy = $this->_getRequestArgument('orderBy')) {

instead of

if (($orderBy = $this->_getRequestArgument('orderBy')) !== null) {

Regards...
Michael

Test script:
---------------
<?php
require 'Structures/DataGrid.php';
$values = array(array("A1","Bx1","C1",),
array("A2","Bc2","C2",),
array("A3","Bz3","C3",),
);
$datagrid =& new Structures_DataGrid();
$test = $datagrid->bind($values, null, DATAGRID_SOURCE_ARRAY);
if (PEAR::isError($test)) {
echo $test->getMessage();
}
$test = $datagrid->render();
if (PEAR::isError($test)) {
echo $test->getMessage();
}
?>

Expected result:
----------------
The sort links should work for all columns.

Actual result:
--------------
Column 0 cannot be sorted.