Hello xwiki Team,
I’m running xwiki 13.2.
I try to iterate over all the pages in my wiki to change the syntax.
My Idea was to iterate over all the Spaces of my Wiki and change the Syntax of every WebHome.
While iterating over all my documents, the xwiki was creating new Pages instead of modifying the correct page.
While I was trying to find my mistake, I was running the following example, which is also iterating over all the Pages
{{velocity}}
#foreach($space in $xwiki.spaces)
* [[$space>>$services.model.createDocumentReference('', $space, '')]]
#end
{{/velocity}}
I got a list with Links to all my pages.
But when I was clicking on those links the wizard for creating a new page was opening up, instead of showing the correct page.
In the URL field of the browser it looks like that xwiki is using the Script Page as Parent for the Page I try to open.
Does anyone have an idea why it is not working?
The Script, that I was running:
{{velocity}}
#foreach($space in $xwiki.getSpaces())
#set($docRef = $services.model.createDocumentReference('', $space, 'WebHome'))
#set($document = $xwiki.getDocument($docRef))
$document.convertSyntax("xwiki/2.1")
$document.save()
#end
{{/velocity}}