Hi Marius,

On Nov 23, 2010, at 9:07 AM, Marius Dumitru Florea wrote:

> Hi devs,
> 
> In revision 30548 (for XE 2.5M1, see 
> http://jira.xwiki.org/jira/browse/XWIKI-5386 ) I changed the behaviour 
> of the XWikiServletURLFactory#getURL(URL, XWikiContext) method. It used 
> to make URLs relative to the current request URL and now it makes URLs 
> relative to the current wiki (set on the xwiki context). Let's take an 
> example:
> 
> request URL: http://playground.xwiki.org/xwiki/bin/view/Sandbox/TestURL
> current wiki (set from velocity script): code (code.xwiki.org)
> URL 1: http://code.xwiki.org/xwiki/bin/view/Main/WebHome
> URL 2: http://playground.xwiki.org/xwiki/bin/view/Spage/Page
> 
> Before: (1) http://code.xwiki.org/xwiki/bin/view/Main/WebHome
>         (2) /xwiki/bin/view/Spage/Page
> 
> Now: (1) /xwiki/bin/view/Main/WebHome
>      (2) http://playground.xwiki.org/xwiki/bin/view/Spage/Page
> 
> The javadoc of XWikiServletURLFactory#getURL(URL, XWikiContext) is not 
> clear on this:
> 
> /**
>  * Converts a URL to a relative URL if it's a XWiki URL (keeping only 
> the path + query string + anchor) and leave
>  * the URL unchanged if it's an external URL.
>  *
>  * @param url the URL to convert
>  * @return the converted URL as a string
>  */
> 
> So what's the correct behaviour?

What's your take? You changed it so you must have had a good reason?

On my side I don't mind that much which we choose (except that I would have 
erred on the safe side and kept the previous behavior not to break anything) 
but we need a quick fix since we've broken the rendering in syntax 1.0 for 
links pointing to other wikis. This should go in 2.5.2 and 2.6.1 I think (in 
addition to trunk).

Thanks
-Vincent






_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to