Unreachable page after rename

Hi.

After (apparently) successfully renaming a page, trying to access it gives me a blank page.
I’m using XWiki 8.4.5 with Mysql database.

I’m not seeing any errors in the logs. In the database the page looks ok, the page appears in the index and all the backlinks where updated correctly.

The problem my be related with the new name having “/” in it. I tryed to follow the instructions in this post from 2009, which suggest using a velocity macro.

The problem I’m having is that after retrieving the document from the database, it is marked as “new” (ie, isNew() == true) and the rename has no effect …

The code I’m using is the following:

#set($oldName = 'Main.Page A.Page B.Old "page name with / and quotes" in it') 
#set($newName = 'Main.Page A.Page B.New "page naem without slash" in it')

## Wiki links
## this link is rendered as an existing page
Old: [[$oldName]] 
## this link is rendered as a new page
New: [[$newName]] 

## Loads page from database
#set($renamedDoc = $xwiki.getDocument($oldName))

## This prints `true`
$renamedDoc.isNew() 

## Try rename
$renamedDoc.rename($newName)

## Try to generate wiki links again. Nothing has changed ...
## this link is rendered as an existing page
Old: [[$oldName]] 
## this link is rendered as a new page
New: [[$newName]] 

The page name also has quotes in it. Don’t know if this has any incidence in the problem.

I think that maybe the same problem that is making the document be marked as “new” is what is causing the blank page and also not allowing the rename…

I’m not even able to delete the page using “delete” in the url. It also gives a blank page.

What can I do?

Probably https://www.xwiki.org/xwiki/bin/view/FAQ/WhyDoIGetABlankPage ?

1 Like

Yes, I’m using Tomcat 8 (is the xwiki docker distribution), so probably this is the issue.

I have now “fixed” the problem by creating a new page and copying the contents from the database, but it would be nice to have a way to do the renaming …

Would be nice to create a jira issue for the docker image at https://jira.xwiki.org/browse/XDOCKER to configure Tomcat to allow / and \ by default.

1 Like

See also http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HAllowing222F22inpagenames

2 Likes

Great. Thanks!

Will create the issue and try to submit a pr with the fix tomorrow.

Awesome! :slight_smile:

Issue created https://jira.xwiki.org/browse/XDOCKER-38

Created a pull request to fix it https://github.com/xwiki-contrib/docker-xwiki/pull/7

Thanks! I’ll check that out today.

Applied, thanks!

1 Like