You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Brian Lawler <br...@tribenetwork.com> on 2004/06/12 10:25:44 UTC

Re: Bug in the new TemplateLink...

Henning-

Thanks for the reply.

On May 9, 2004, at 3:34 PM, Henning P. Schmiedehausen wrote:

> Brian Lawler <bp...@pacbell.net> writes:
>
>> Hey guys-
>
>> We found a bug today in the new TemplateLink code in on the 2.3 branch
>> where the reference is not cleared out when rendering the link in a
>> template.  This result is that a call to setReference will be rendered
>> in each subsequent call to $link.  Here is a patch that fixes our
>> problem.  It may be more wise to add a removeReference() method on
>> templateURI - if you would rather go that direction let me know and I
>> will whip it together - just touches more code.
>
> ...
> However, I always thought of the reference being part of the URI
> (without any parameters) and the getRelativeLink/getAbsoluteLink
> return an URI with parameters and then clear the parameter parts of an
> URI (which are pathInfo and the Query String). These methods don't
> touch any part of the URI itself.
>
> So IMHO, the current behaviour is sensible and I will not change it.

I would agree with you here except that the lifecycle of the $link 
object makes this a rather peculiar behavior.  If you use $link 30 
times in a page, and on the first one you do a $link.setReference(), 
the reference will show up in every link rendered afterwards unless you 
explicitly blank it out.  I am confused as to why this is any different 
than clearing out parameters and path info.  If, on the other hand, 
$link somehow spit out a new instance of, say, a TurbineURI object then 
none of this would be an issue, but that would most certainly break 
code somewhere that relies on $link accumulating parameters.

Thanks again for the response though!

-B


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org