Hi all,
I'm trying to use the delete space code snippet I found on the
xwiki.org
website. I got a Null Pointer Exception when deleting pages (even if I
have administrator rights on the wiki).
If I use other function on the documents (as, rename for example) they
work fine. Here is the code for the panel:
#panelheader('Spaces')
#if($request.space)
#if($request.confirm=="1")
#foreach($item in $xwiki.getSpaceDocsName($request.space))
$xwiki.getDocument("${request.space}.${item}").delete()
#end
#else
[Confirm delete space
${request.space}>$doc.fullName?space=${request.space}&confirm=1]
<br>List of docs that will be deleted
#foreach($item in $xwiki.getSpaceDocsName($request.space))
* $item
#end
#end
#else
#foreach($space in $xwiki.spaces)
$space \[[Delete>$doc.fullName?space=${space}]\]<br/>
#end
#end
#panelfooter()
I have also used the function checkAccess("delete"), and it returns
true, so I'm sure that I have right to delete the document.
Any idea of what's going on? Thanks!
Vito