Re: [xwiki-users] Macro not not working after upgrade
On Thu, Jun 7, 2012 at 10:38 AM, Moritz Hesse (EA GmbH) <moritz.hesse@ea-gmbh.de> wrote:
Hi Thomas,
thanks for your respond.
we were upgrading from XWiki 3.5 to Version 4. After upgrading successfully a self coded macro does not work anymore whereas all relevant files and contents are at its right place but it simply does not output anything (I don't know if the macro code runs through but does not output anything or if macro is not even executed).
Hard to tell you exactly what is the issue without more informations. First thing what kind of macro are you referring to (Wiki macro, java macro, velocity macro, etc.) ?
This is a regular velocity macro to display subpages as if you click on the information tab below the wiki page:
{{velocity}} #if($doc.name=="WebHome") #set($tree = $xwiki.doctree.getSpaceDocumentTree($doc.web)) #else #set($tree = $xwiki.doctree.getDocumentTree($doc)) #end #set($depths=["", "*", "**", "***", "****", "*****", "******", "*******", "********"])
#foreach($leaf in $tree) #if($leaf.depth <= 8 && ($leaf.depth != 0 || $doc.name=="WebHome")) $depths.get($leaf.depth) [[$xwiki.getDocument($leaf.fullName).getDisplayTitle()>>$leaf.fullName]] #end #end {{/velocity}}
Ok so that's actually a velocity script and not a macro or any kind (the {{velocity}} itself is a macro that you use to write a script) :) Hard to tell you what's exactly wrong, you will have to debug a bit. For example are you sure $xwiki.doctree plugin is still here ? Maybe you forgot to put it in your new instance.
Worked beatifully in 3.5, but does not work anymore with 4.0.
to be honest - ugly: "platform.appwithinminutes.appHomePageDescriptionHeading" instead of "Projects". What went wrong?
This looks like missing translations. Did you overwritten XWiki.XWikiPreferences page ?
Furthermore, the title of our appw/minutes look extremely disturbing and
What you mean by overwritten? We have taken all 4.0 files to replace 3.5 files. But we have not manually changed them.
The translation pages are registred in XWiki.XWikiPreferences page which is one of the page you generally should never ovewrite when upgrading exactly for this kind of issues. See http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Upgrade#HUpgradingwikido... for more details.
Thanks and bests, Moritz
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Furthermore, the title of our appw/minutes look extremely disturbing and - to be honest - ugly: "platform.appwithinminutes.appHomePageDescriptionHeading" instead of "Projects". What went wrong?
This looks like missing translations. Did you overwritten XWiki.XWikiPreferences page ?
What you mean by overwritten? We have taken all 4.0 files to replace 3.5 files. But we have not manually changed them.
The translation pages are registred in XWiki.XWikiPreferences page which is one of the page you generally should never ovewrite when upgrading exactly for this kind of issues. See
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Upgrade#HUpgradingwikido cuments
for more details.
How can I access this page to see if I can fix it there?
{{velocity}} #if($doc.name=="WebHome") #set($tree = $xwiki.doctree.getSpaceDocumentTree($doc.web)) #else #set($tree = $xwiki.doctree.getDocumentTree($doc)) #end #set($depths=["", "*", "**", "***", "****", "*****", "******", "*******", "********"])
#foreach($leaf in $tree) #if($leaf.depth <= 8 && ($leaf.depth != 0 || $doc.name=="WebHome")) $depths.get($leaf.depth)
[[$xwiki.getDocument($leaf.fullName).getDisplayTitle()>>$leaf.fullName
]] #end #end {{/velocity}}
Ok so that's actually a velocity script and not a macro or any kind (the {{velocity}} itself is a macro that you use to write a script) :)
Hard to tell you what's exactly wrong, you will have to debug a bit. For example are you sure $xwiki.doctree plugin is still here ? Maybe you forgot to put it in your new instance.
I know that this as is just is a velocity sniplet, but I implemented it as a macro: I added a MacroClass to a specific page and I configed it that way that I could call it by {{childrenpagetree/}}. But as mentioned, this doesn't work anymore. What can I have destroyed while upgrading from 3.5 to 4.0? By the way: Macros in general do work. We have recently developed another macro (in 4.0) which also works. Thanks and best regards, Moritz
participants (2)
-
Moritz Hesse (EnergieArchitektur) -
Thomas Mortagne