Broken page - unable to delete, rename or move

I’m in the process of migrating from a SharePoint based wiki to XWiki and have run into an issue where I have copied and pasted a page name from SharePoint that appears to have a ‘LATIN SMALL LETTER A WITH CIRCUMFLEX’ character included within it. Upon saving the page in XWiki the character is replaced with a ? within all navigation labels to the page and when navigating to the page the ? is replaced with a %3F in the url but I get an XWiki ‘The request page could not be found message’. Removing the %3F allows me to view the page but any attempts to delete, rename of move the page results in the not found message again.

I’ve found the page in the xwikidoc table in the database and the XWD_FULLNAME, XWD_TITLE, XWD_WEB and XWD_PARENT columns all include the question mark. Am I safe to correct the data in the database or is there another way to fix this?

Thanks,

Ben

A bit late, but still my 2 cents:

It is not safe to remove the question mark in the database, as the ids for the tables contain a hash value that likely includes the character in question.

The letter should be representable in the DB. Are you sure the DB Encoding is set up UTF-8?

Anyway, if you can view the page, you can also call the “delete” view, just by replacing the “/view/” part of the URL by “/delete/”

If that still not works, create a new page and add the following velocity content inside (via the Wiki editor):

{{velocity}}
#set($docToDelete = $xwiki.getDocument("<full name of the page here>"))
#if ($docToDelete.isNew())
   The document $docToDelete cannot be found.
#else
   $docToDelete.delete()
   The document $docToDelete has been removed.
#end
{{/velocity}}

View the page and tweak the full name of the document until it does away.

Thanks for your reply/ I’ve copied the full name of the page from the database and have inserted it in the relevant place however I get the document cannot be found message. I’ve tried a few variations of the full name without success. I also tried running a query to get the document by its id then using this in the getDocument call but this made no difference.

I don’t need the page so am I able to ‘fix’ the full name in the database then delete using the above script as my guess is that the ? is tripping things up?

Just to add we are running XWiki on SQL Server which may complicate things?

If you already have a query to fetch the page, but the query fails to return results, maybe you can try to widen the search criteria a bit, like:

 where doc.fullName like '....%....'

where the ‘%’ is put in the place where in the original page name the ‘?’ is shown.
Better disable the part that actually deletes the pages found in case the query finds too much stuff. :open_mouth:

Aside of that I feel that something is not property configured in your database connection. If the database stores an accented character as a single byte thing that looks like a ‘?’ then the database tables are likely UTF-8, but the connection sends data e.g. in Latin1. Some setting in the hibernate.cfg.xml might be needed. You might try to use a tag with an accented character when debugging this, as malformed tags can be removed easier than pages (if not via the normal UI, then via the object editor).