PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Structures » Structures_DataGrid_Renderer_Smarty » Bug #9493

_SmartyGetPaging doesn't inherit selfPath option

Details

Submitted2006-11-28 23:51 UTC
Frompecus at pecus dot it
Assignedolivierg
StatusClosed
PackageStructures_DataGrid_Renderer_Smarty
PHP Version4.3.10
OSWindows XP
Roadmaps(Not assigned)

Comments

[2006-11-28 23:51 UTC] pecus at pecus dot it

Description:
------------
I am using rewrites for pages URLs, so that /home/catalogue/category/TENTS maps to /net/page.php?area=/home/catalogue&cat=TENTS

With the Smarty renderer (which calls Pager renderer and Pager package), when passing selfPath as a renderer option, columns link use the correct link (eg. /home/catalogue/category/TENTS?orderBy=p1&direction=DESC&page=2), but paging links do not (/net/page.php?orderBy=p1&direction=DESC&page=2).

The code is sampled directly from the example in the smarty renderer:

<code>
$datagridOptions["generate_columns"] = true;
$datagridOptions["fields"] = array_unique(array_merge($genericFields, $GC_extraFields));

//$SQLresult is array()
$test = $datagrid->bind($SQLresult, $datagridOptions);

$rendererOptions = array(
'sortIconASC' => '⇑',
'sortIconDESC' => '⇓',
'selfPath' => '/path/to/rewrite/url/page',
'excludeVars' => array ('lang', 'area', 'category')
);

$datagrid->fill($smarty, $rendererOptions);
</code>

Smarty template:

<code>
{getPaging prevImg="«" nextImg="»" separator="|" delta="5"}
</code>

selfPath should be propagated as the urlVar pagerOption.

Platform: winXP, PHP 4.3.10, Apache 1.3.33.

Pager 2.4.2 stable
Structures_DataGrid 0.7.2 beta
Structures_DataGrid_Renderer_Pager 0.1.0 beta
Structures_DataGrid_Renderer_Smarty 0.1.2 beta

[2006-11-29 10:57 UTC] olivierg at php dot net

(changing package and assigning bug)

[2006-11-29 10:58 UTC] olivierg at php dot net

(changing package version)

[2006-11-29 12:46 UTC] olivierg at php dot net

Thank you for this detailed report.
This bug has been fixed in CVS, and will be available in the next release.

Have a good day

[2006-11-29 12:48 UTC] olivierg at php dot net

Correcting myself: the fix will be available in the next release. Hopefully not the bug ;)