Forum OpenACS Development: Re: ad_page_contract optional default will clober a local var value

Jun, I don't think Tom's accusing you of making changes willy-nilly to the core APIs.  This is not the first time the subject of changing the core API without notice has come up - just the first time in awhile because we've educated ourselves not to do so.

But a bunch of us have made this particular error in the past, don't feel like you're being singled out other than of course you happened to make this particular change.

As far as ad_page_contract itself goes, I agree with Tom and would personally prefer that it flag as an error any existing Tcl var with the same name as one of the vars listed as potential GET or POST values being passed to the page. I don't feel strongly enough about this to post a TIP but I'm not supportive of your suggested change, either.

And to make things clear, that's in no way personal, I just disagree with your thinking in this particular case.

Absolutely, Jun, this is nothing personal, at all. I know I am less than diplomatic at times (like most of the time), so take that into account as well.

I did a little more digging on the effect of the patch. It actually turns out that the effect would be that any existing variable would skip validation/filtering completely, although post filters will still run. But the main filters are skipped because the variable isn't in the form.

I think Jun can get the effect he wants by doing the following:

  • Remove the variable from the environment that calls ad_page_contract.
  • Put the variable into the request form as a query var.
  • Call ad_page_contract