[xwiki-users] Two spaces with same name
I currently have two spaces, one called "Environment And Sustainability" and the other called "Environment+And+Sustainability". If I try to delete the only page in the erroneous space it says "The requested document could not be found". So if the page isn't there, why is the space there? Martin
Are you sure there is only one page ? Maybe you have a "WebHome" page too in this spaces ? Did you checked with document index ? How do you delete/access the page ? On Wed, Apr 18, 2012 at 6:54 PM, Martin Evans <[email protected]> wrote:
I currently have two spaces, one called "Environment And Sustainability" and the other called "Environment+And+Sustainability". If I try to delete the only page in the erroneous space it says "The requested document could not be found". So if the page isn't there, why is the space there?
Martin _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
On 04/18/2012 12:54 PM, Martin Evans wrote:
I currently have two spaces, one called "Environment And Sustainability" and the other called "Environment+And+Sustainability". If I try to delete the only page in the erroneous space it says "The requested document could not be found". So if the page isn't there, why is the space there?
Some containers perform a double decoding of the URL, I noticed that in Tomcat, for example. Normally, + is considered an encoding for the space character in URLs. This means that an URL containing + actually refers to spaces. We get around this by actually encoding the + character with its proper URL escape, %2B, and this should be properly decoded back into +, except on Tomcat, where this + is decoded one more time into a space. So while the browser asks for the "Environment%2BAnd%2BSustainability" URL, which corresponds to the "Environment+And+Sustainability" space, Tomcat converts that into "Environment And Sustainability". Your only chance is to delete it from a script: {{velocity}} $xwiki.getDocument('Name of document').delete() {{/velocity}} Replace 'Name of document' with the exact document name, something like 'Environment+And+Sustainability.WebHome'. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Thanks for help, Sergiu, But in my case the page is on it's place, Script doesn't delete it. :-( Dmitry Thu, 19 Apr 2012 11:46:54 -0400 от Sergiu Dumitriu <[email protected]>:
On 04/18/2012 12:54 PM, Martin Evans wrote:
I currently have two spaces, one called "Environment And Sustainability" and the other called "Environment+And+Sustainability". If I try to delete the only page in the erroneous space it says "The requested document could not be found". So if the page isn't there, why is the space there?
Some containers perform a double decoding of the URL, I noticed that in Tomcat, for example. Normally, + is considered an encoding for the space character in URLs. This means that an URL containing + actually refers to spaces. We get around this by actually encoding the + character with its proper URL escape, %2B, and this should be properly decoded back into +, except on Tomcat, where this + is decoded one more time into a space. So while the browser asks for the "Environment%2BAnd%2BSustainability" URL, which corresponds to the "Environment+And+Sustainability" space, Tomcat converts that into "Environment And Sustainability". Your only chance is to delete it from a script:
{{velocity}} $xwiki.getDocument('Name of document').delete() {{/velocity}}
Replace 'Name of document' with the exact document name, something like 'Environment+And+Sustainability.WebHome'. -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Kind regards, Dmitry
participants (4)
-
Dmitry Bakbardin -
Martin Evans -
Sergiu Dumitriu -
Thomas Mortagne