Forum OpenACS Development: Bug in template::paginator. My bad I think

Hello everyone,

some time ago I have touched template::list allowing to retrieve the full number of records extracted by pagination.

Now I think I have found a regression because of this. These are the steps to reproduce the problem on a current installation:

- open a xowiki instance an enter the admin page
- click on categories
- click on an existing category tree name or create one
- click on an existing category name or create one to open the page where usages of such category are shown

On my installation this leads to an error caused by "template::paginator::create" proc: since my change this proc requires 4 arguments instead of 3, bacause one should supply also the query to count the records. Script /packages/categories/www/cadmin/category-usage.tcl doesn't know about this an passes fourth argument "-pagesize" to the proc.

This happens also in script /packages/categories/www/categories-browse.tcl for the same reason (and maybe somewhere else?)

This scripts are particular, as they call template::paginator directly, rather than by calling template::list, and I have missed this use case...

Before I think about a fix (I may have found one), can you reproduce the issue, or am I missing some update?

Collapse
Posted by Antonio Pisano on
Meanwhile I have fixed the issue on my installation by moving all the logic to retrieve the count only into template::paginator::init.

This way public procs won't change anymore and the new feature will be transparent to existing code.

I'd prefer to commit the change after I receive confirmation of this bug, so I will wait for a couple of days

All the best

Antonio

Collapse
Posted by Antonio Pisano on
Ehm... my fix was not sufficient. I need to reflect on this... I will take some time.
Collapse
Posted by Gustaf Neumann on
I can reproduce this bug -g
Collapse
Posted by Antonio Pisano on
Ok, I have committed a fix I have tested both in the scenario I have described than in regular lists from mi instance.

I had to use some tricks to avoid breaking any api... hope History won't judge me too much 😊

Due to cache behavior, I had to restart my instance after changes have been applied, otherwise my lists just came out empty. For you to know...

All the best

Collapse
Posted by Gustaf Neumann on
Antonio, many thanks. I've integrated the changes to the oacs-5-9 branch and updated openacs.org with this. From clicking around (including categories) everything looks fine.