[xwiki-users] delete pages with unallowed characters in their names
Hi guys, is raw database hacking the only way to remove such pages? e.g. when looking at the orphaned pages tab in AllDocs, I find documents, generated through faulty code evaluation, such as .../SpaceName/<em class= , so to say, somehow the page was created with somje html stuff in its name. I've got lots of other examples. But when clicking on delete, XWiki tells me, that the page does not even exist yet. So, what can I do to delete it without hacking in the database itself. thanx for any suggestions Sebastian
Hi Sebastian, To hack the database is always a delicate issue! Perhaps this could help you... http://www.xwiki.org/xwiki/bin/view/FAQ/HowToDeleteAnInaccessibleDocument Please, let us know is this makes the trick. Thanks. Cheers, Ricardo Sebastian Kannengiesser wrote:
Hi guys,
is raw database hacking the only way to remove such pages?
e.g. when looking at the orphaned pages tab in AllDocs, I find documents, generated through faulty code evaluation, such as .../SpaceName/<em class= , so to say, somehow the page was created with somje html stuff in its name. I've got lots of other examples. But when clicking on delete, XWiki tells me, that the page does not even exist yet. So, what can I do to delete it without hacking in the database itself.
thanx for any suggestions Sebastian _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
-- Ricardo Rodríguez Your EPEC Network ICT Team
Hi Ricardo, thanx for the tip, but apparently in my case it does not work. Doing just the $xwiki.getDocument("myspace.<em class=") return me the document as I find by looking at the class field of the returned object. But calling delete on it has no effect. :( Cheers, Sebastian On Wed, May 27, 2009 at 11:54 PM, [Ricardo Rodriguez] Your EPEC Network ICT Team <webmaster@environmentalchange.net> wrote:
Hi Sebastian,
To hack the database is always a delicate issue!
Perhaps this could help you...
http://www.xwiki.org/xwiki/bin/view/FAQ/HowToDeleteAnInaccessibleDocument
Please, let us know is this makes the trick. Thanks.
Cheers,
Ricardo
Sebastian Kannengiesser wrote:
Hi guys,
is raw database hacking the only way to remove such pages?
e.g. when looking at the orphaned pages tab in AllDocs, I find documents, generated through faulty code evaluation, such as .../SpaceName/<em class= , so to say, somehow the page was created with somje html stuff in its name. I've got lots of other examples. But when clicking on delete, XWiki tells me, that the page does not even exist yet. So, what can I do to delete it without hacking in the database itself.
thanx for any suggestions Sebastian _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Hi Sebastian, Sebastian Kannengiesser wrote:
Hi Ricardo,
thanx for the tip, but apparently in my case it does not work.
Doing just the $xwiki.getDocument("myspace.<em class=") return me the document as I find by looking at the class field of the returned object. But calling delete on it has no effect. :( It works for me both in XE 1.8.3.19546 and 1.3.8295 releases. Are you using an administrator as loged user? It is the only problem I can think of now.
HTH, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
Hi, On Thu, May 28, 2009 at 5:28 PM, [Ricardo Rodriguez] Your EPEC Network ICT Team <webmaster@environmentalchange.net> wrote:
Hi Sebastian,
Sebastian Kannengiesser wrote:
Hi Ricardo,
thanx for the tip, but apparently in my case it does not work.
Doing just the $xwiki.getDocument("myspace.<em class=") return me the document as I find by looking at the class field of the returned object. But calling delete on it has no effect. :( It works for me both in XE 1.8.3.19546 and 1.3.8295 releases. Are you using an administrator as loged user? It is the only problem I can think of now.
HTH,
Ricardo
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Sometimes it's because the page name actually has a space at the end: Page+Name+ is displayed as Page Name You could try using the method Ricardo advised you to but adding one or more "+" to the end of the document name and see what happens. Guillaume -- Guillaume Lerouge Product Manager - XWiki Skype ID : wikibc http://guillaumelerouge.com/
Sebastian Kannengiesser wrote:
Hi Ricardo,
thanx for the tip, but apparently in my case it does not work.
Doing just the $xwiki.getDocument("myspace.<em class=") return me the document as I find by looking at the class field of the returned object. But calling delete on it has no effect. :(
That is because the document name isn't "<em class=". First find out the real document name with: #foreach($i in $xwiki.searchDocuments(" where doc.space like '%class=%'")) * $xwiki.getXMLEncoded($i) #end then use that as the document name.
On Wed, May 27, 2009 at 11:54 PM, [Ricardo Rodriguez] Your EPEC Network ICT Team <webmaster@environmentalchange.net> wrote:
Hi Sebastian,
To hack the database is always a delicate issue!
Perhaps this could help you...
http://www.xwiki.org/xwiki/bin/view/FAQ/HowToDeleteAnInaccessibleDocument
Please, let us know is this makes the trick. Thanks.
Cheers,
Ricardo
Sebastian Kannengiesser wrote:
Hi guys,
is raw database hacking the only way to remove such pages?
e.g. when looking at the orphaned pages tab in AllDocs, I find documents, generated through faulty code evaluation, such as .../SpaceName/<em class= , so to say, somehow the page was created with somje html stuff in its name. I've got lots of other examples. But when clicking on delete, XWiki tells me, that the page does not even exist yet. So, what can I do to delete it without hacking in the database itself.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu Dumitriu wrote:
Sebastian Kannengiesser wrote:
Hi Ricardo,
thanx for the tip, but apparently in my case it does not work.
Doing just the $xwiki.getDocument("myspace.<em class=") return me the document as I find by looking at the class field of the returned object. But calling delete on it has no effect. :(
That is because the document name isn't "<em class=". First find out the real document name with:
#foreach($i in $xwiki.searchDocuments(" where doc.space like '%class=%'"))
Sorry, it was supposed to be doc.name, not doc.space
* $xwiki.getXMLEncoded($i) #end
then use that as the document name.
On Wed, May 27, 2009 at 11:54 PM, [Ricardo Rodriguez] Your EPEC Network ICT Team <webmaster@environmentalchange.net> wrote:
Hi Sebastian,
To hack the database is always a delicate issue!
Perhaps this could help you...
http://www.xwiki.org/xwiki/bin/view/FAQ/HowToDeleteAnInaccessibleDocument
Please, let us know is this makes the trick. Thanks.
Cheers,
Ricardo
Sebastian Kannengiesser wrote:
Hi guys,
is raw database hacking the only way to remove such pages?
e.g. when looking at the orphaned pages tab in AllDocs, I find documents, generated through faulty code evaluation, such as .../SpaceName/<em class= , so to say, somehow the page was created with somje html stuff in its name. I've got lots of other examples. But when clicking on delete, XWiki tells me, that the page does not even exist yet. So, what can I do to delete it without hacking in the database itself.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Guys, thanx for all your tips. Especially the getXMLEncoded thing is nice to know of. But in my case, the document is not found with that statement, i.e. the foreach loop is not even iterated once. I understand there must be a way, otherwise, how could the Orphaned pages code find the document. I will try a little more and let you know, when and how I got successful. Many thanx again so far. Cheers an have a nice weekend, Sebastian On Thu, May 28, 2009 at 8:30 PM, [Ricardo Rodriguez] Your EPEC Network ICT Team <webmaster@environmentalchange.net> wrote:
Hi!
Sergiu Dumitriu wrote:
Sorry, it was supposed to be doc.name, not doc.space
Thanks Sergiu! I was getting an error and I was not able to explain it!
Cheers
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Hi Sebastian, On Fri, May 29, 2009 at 1:59 PM, Sebastian Kannengiesser < sebastian.kannengiesser@gmail.com> wrote:
Guys, thanx for all your tips. Especially the getXMLEncoded thing is nice to know of. But in my case, the document is not found with that statement, i.e. the foreach loop is not even iterated once.
I understand there must be a way, otherwise, how could the Orphaned pages code find the document. I will try a little more and let you know, when and how I got successful.
Not sure whether this would work, but since the documents are found by the Orphaned Pages query, here's what you could try: - Look at the orphaned documents page - Identify all pages that you want to keep - Edit those pages and give them a parent -> only faulty pages will now appear on the orphaned docs page - Run a script to delete those pages The script would look something like: #set($sql = " where doc.parent='' and doc.name<> 'WebHome'") #foreach ($item in $xwiki.searchDocuments($sql)) #set($itemdoc = $xwiki.getDocument($item)) $itemdoc.delete() #end Good luck, Guillaume
Many thanx again so far.
Cheers an have a nice weekend, Sebastian
On Thu, May 28, 2009 at 8:30 PM, [Ricardo Rodriguez] Your EPEC Network ICT Team <webmaster@environmentalchange.net> wrote:
Hi!
Sergiu Dumitriu wrote:
Sorry, it was supposed to be doc.name, not doc.space
Thanks Sergiu! I was getting an error and I was not able to explain it!
Cheers
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
-- Guillaume Lerouge Product Manager - XWiki Skype ID : wikibc http://guillaumelerouge.com/
Sebastian Kannengiesser wrote:
Guys, thanx for all your tips. Especially the getXMLEncoded thing is nice to know of. But in my case, the document is not found with that statement, i.e. the foreach loop is not even iterated once.
I understand there must be a way, otherwise, how could the Orphaned pages code find the document. I will try a little more and let you know, when and how I got successful.
Maybe the document name does not have that fragment. Just look at all the document names and see which one looks broken: #foreach($i in $xwiki.searchDocuments(" where 1=1 ")) * $xwiki.getXMLEncoded($i) #end -- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi guys, solved it. The document was called SpaceName.__, so just two underscores. So the "<em class=" thing was just a faulty rendering on the orphaned pages page. I had this issue on XWiki 1.7.2, don't know, whether it is still an issue on 1.8 and 1.9. Can you reproduce it by creating a page with the two underscores. Cheers, Sebastian On Fri, May 29, 2009 at 3:10 PM, Sergiu Dumitriu <sergiu@xwiki.com> wrote:
Sebastian Kannengiesser wrote:
Guys, thanx for all your tips. Especially the getXMLEncoded thing is nice to know of. But in my case, the document is not found with that statement, i.e. the foreach loop is not even iterated once.
I understand there must be a way, otherwise, how could the Orphaned pages code find the document. I will try a little more and let you know, when and how I got successful.
Maybe the document name does not have that fragment. Just look at all the document names and see which one looks broken:
#foreach($i in $xwiki.searchDocuments(" where 1=1 ")) * $xwiki.getXMLEncoded($i) #end
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Sebastian Kannengiesser wrote:
Hi guys,
solved it. The document was called SpaceName.__, so just two underscores. So the "<em class=" thing was just a faulty rendering on the orphaned pages page.
I had this issue on XWiki 1.7.2, don't know, whether it is still an issue on 1.8 and 1.9.
Can you reproduce it by creating a page with the two underscores.
It is mostly fixed in 1.9 and 2.0, it might still cause problems in custom content. The 2.0 syntax should not behave like this at all, though. -- Sergiu Dumitriu http://purl.org/net/sergiu/
The following may provide some hints w/r/t directly deleting malformed pages from the database: http://nielsmayer.com/whatididtopoorsql.txt There are unresolved bugs related to this class of issues: http://jira.xwiki.org/jira/browse/XE-376 http://jira.xwiki.org/jira/browse/XE-336 IMHO, I think this class of issue should be given higher priority as it is easy to generate all kinds of system errors just from normal user-activity -- such as entering "everyday usage" characters in a document title or document name. It is somewhat scary opening up a wiki to the "unwashed masses" knowing they can cause errors that require SQL surgery to the database. Also, it seems like there should be an "encoding" fix for this, given that it's possible to even have "nonwestern" chars and text directions as a URL: http://ar.wikipedia.org/wiki/%D8%A7%D9%84%D9%85%D9%85%D9%84%D9%83%D8%A9_%D8%... See http://forums.mozillazine.org/viewtopic.php?f=7&t=557289&start=0&st=0&sk=t&s... details. Niels http://nielsmayer.com
participants (5)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Guillaume Lerouge -
Niels Mayer -
Sebastian Kannengiesser -
Sergiu Dumitriu