Forum OpenACS Q&A: Signing variables in a list builder order by

Hi everyone

Just wondering if anyone has a suggestion for how to sign variables on pages that use list builder, in a way that still allows sorting to work? I guess I'm really asking how to sign a list builder filter.

I have a page with a key (party_id) that I sign in the ad_page_contract:

Then I pass the party_id to the list builder as a filter:
lappend filter party_id {where_clause {AND 1 = 1}}

And my template::list::create has a -filters $filter clause.

This all works perfectly if I don't add the "verify" in the page contract.

I've tried adding "party_id:sig" to the filters, but it seems to ignore it.
lappend filter "party_id:sig" {where_clause {2 = 2}}

I've even tried set "party_id:sig" [ns_queryget "party_id:sig"]

I can see that I would have probably to change template::list::get_url to get it to allow me to sign one of the page variables, but it doesn't look like a very easy change, so I thought I'd ask before rolling up my sleeves.

Any suggestions? Is there a way to do this using filters?


Posted by Brian Fenton on
To answer my own question, and in case someone else comes here looking for this, the solution is in fact very simple. You just need to sign the filter variable e.g.

lappend filter party_id:sign {where_clause {AND 1 = 1}}

If only all fixes were so easy!