Forum OpenACS Development: Re: FYI: User message feature

Collapse
Posted by Tilmann Singer on
Cool feature - (why would anyone want that to be removed?)!

I don't know about problems with clustered sites, but putting the message in the url has a few drawbacks. For example that the message will be displayed again when doing a reload of the page, or when mailing/bookmarking the url.

Samer, this is a 'don't break existing code' issue. Adding a new proc that redirects and aborts is fine, but changing the default behaviour of ad_returnredirect now would break existing code that relys on that behaviour. I think the -abort switch is a nice compromise - this way we don't even have to remember a new proc name.

Collapse
Posted by Lars Pind on
One drawback of adding switches to ad_returnredirect: If you redirect to a URL that happens to start with a hyphen, it will break, unless you put "--" in front of it.

Is that something we need to be concerned with?

/Lars

Collapse
Posted by Andrew Piskorski on
Offhand, I doubt that URLs starting with "-" occur anywhere in OpenACS in practice.

But this is a good example of one of Tcl's minor but annoying warts. I tend to habitually use "--" everywhere I think it might work, until "Oops, got an error, oh yeah, this particular Tcl command doesn't accept the '--' option, take it out."

And once you define a proc with no option switches at all, it seems that for 100% backwards compatibility you must never add any switches ever. Actually, hm, I suppose you could kludge something into ad_returnredirect to check the number of arguments it received, and implicitly add the "--" if necessary. That means doing its own parsing rather than using ad_proc though, which is probably both not worth it and a bad idea. Instead, perhaps it would be worthwhile to extend ad_proc itself to optionally support some such feature?