Gossamer Forum
Home : Products : Gossamer Links : Discussions :

turning dynamic off

Quote Reply
turning dynamic off
Hi there,

I'm running into some situations where I need to turn a dynamic preserve field on and then turn it off.
ie. set d=1 and then set d=0.

I've tried doing it with
<%set d=0%>
but d still remains 1.

if I build a url with something like this:
<a href="<%db_cgi_url%>/page.cgi?d=0">
then the next time through d becomes
d=ARRAY(0x8beof)
or something, effectively rendering d = something other than off.

Is there a way of turning of any of the dynamic preserve fields once they've been turned on?

peace.

Kyle
Quote Reply
Re: [klangan] turning dynamic off In reply to
You've hit a bug I've not been able to track well enough to report clearly to Alex. I've mentioned it once or twice though.

I wonder if it has something to do with upgrading and templates, but the d= parameter gets screwed up sometimes. Oddly, I can't make it happen, but it happens on it's own when I'm not looking.

I have had it happen on both my customized sites using detail_page.cgi and other such scripts, as well as non-modified sites. The only thing they had in common is they weren't using strictly the default template set, but a mix of old/new templates.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] turning dynamic off In reply to
Thanks for you comments, this has been my experience with the d as well. When links became 2.05 d=1 was suddenly able to become an array. Something about the earlier version made it so d could be equal to only the value to which it was set. (ie. 1 or someother character or nothing). That was very nice and kept things clean. Now, if a url has d=1&d=1 (for whatever reason) the cgi parser seems to interpret it as d=1,1 which then comes back to us as an array. Kind of annoying. I was getting this from time to time when I used the wrong kind of template parsing call in my globals.
like this:
return Links::SiteHTML::display() this parses and results in double parsing.
and this
return Links::user_page() this doesn't parse and keeps d clean.

Anyway, my goal is turn d=1 into d=0 simply so I can redefine one of my other dynamic preserve fields. If there's a way to redefine a dynamic preserve field, I'm all ears.

there's an incomplete discussion of this in this forum post.
http://www.gossamer-threads.com/...orum.cgi?post=157413

Thanks again for taking the time to respond pugdog.

peace.

Kyle
Quote Reply
Re: [klangan] turning dynamic off In reply to
A hah! I didn't realize that, since I had ?d=1&d=1 on some URLs (due to rewrite rules and the new default to d=0 on page.cgi), but I think I got lost in the 2.05 to 2.1 transition (I had one site still running 2.05.

I'll have to play with that tonight, but I think you did quantify it, and it makes sense from what I remember happening.

Alex would have to address this :) But at least it's starting to make sense <G>

Once the d parameter gets messed up, there is no easy way to break out of it. And, there is no way for a user of the site to even know that is what is going on.

I wonder if just a bit of code at the top of page.cgi to check the d= parameter, test if it's a hash, test the values, and if it is a hash, maybe re-parse the input string, and take the last defined value of d ??

Although, it might be easier, where you want to force d=0, to define another flag, such as set_d and give it a value of 1 or 2. Add a check at the top of page.cgi, and if set_d eq 1, then assign $IN->param('d', '1'). If it was 2, assign it the value of 0.

Would that work?


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.