On Sep 4, 2009, at 10:30 AM, Thomas Mortagne wrote:
On Fri, Sep 4, 2009 at 10:07, Vincent Massol<[email protected]> wrote:
Hi,
Im trying to fix http://jira.xwiki.org/jira/browse/XWIKI-4274
Basically if you do $xwiki.getDocument("someDoc").getRenderedContent() it'll get executed in the context of the current doc which I believe is wrong especially since other signatures of getRenderedContent() execute in the target document's context.
I have fixed this locally but found that admin.vm for example is assuming that getRenderedContent() will get executed in the context of the calling doc (i.e. XWiki.Import when doing an import for example). FYI the chain flow is admin.vm -- getRenderedContent() --> XWiki.AdminSheet --> XWiki.AdminImportSheet --> importinline.vm, which requires the current doc to be XWiki.Import (to get/put attachments from/to it). I can fix this easily using a new getRenderedContent signature I've introduced.
However I'm wondering if we have other places that incorrectly use getRenderedContent() and assume it won't be rendered in the context of the target document.
Is this change too dangerous to make? If not know, we'll need to it quickly (2.1M1?) since it's an important bug IMO.
Yes it's a dangerous fix I think, getRenderedContent() is really not an hidden method so changing its behavior that much even if it's a fix is dangerous anyway.
But would you be ok to make this change in 2.1M1? Or would you prefer we live with it and instead document that it doesn't execute in the document's contex (and instead add a new method that does)? It's much simpler for sure but keeps adding to the mess. We could decide to keep adding to the mess and fix it when we rewrite that part in some far future. Thanks -Vincent