Closed
Bug 1145580
Opened 10 years ago
Closed 10 years ago
[Page move] Do not allow "/" as the last character for the destination
Categories
(developer.mozilla.org Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: fs, Unassigned)
Details
(Whiteboard: [specification][type:bug])
What did you do? ================ 1. Moved https://developer.mozilla.org/en-US/docs/nsLocalFile to https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components/ What happened? ============== I was too quick and the URL https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components/ is wrong. The document is now inaccessible as the trailing slash gets removed by Firefox and I only get to see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components What should have happened? ========================== I should have been less quick and moved the page to https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile However, the wrong slug was not caught either. Probably should have been. So, do not perform page moves, if the last character in the destination URL is a slash "/". Is there anything else we should know? ====================================== Please move the inaccessible doc to the right location, too. I will be less quick next time.
Reporter | ||
Comment 1•10 years ago
|
||
The document is https://developer.mozilla.org/admin/wiki/document/10791/
Comment 2•10 years ago
|
||
:groovecoder, can you help restore the page? Fixing the trailing slash bug is a minor priority, but we've lost some content.
Severity: normal → minor
Flags: needinfo?(lcrouch)
Comment 3•10 years ago
|
||
I'm confused ... the title of https://developer.mozilla.org/admin/wiki/document/10791/ is "nsDirectoryService" ? That doesn't seem like it should be the nsLocalFile article?
Flags: needinfo?(lcrouch) → needinfo?(fscholz)
Reporter | ||
Comment 4•10 years ago
|
||
Yes, and that title is correct. The slug is wrong: It is: [1] Mozilla/Tech/XPCOM/Reference/Components/ but should be: [2] Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile The parent page is also correct, it is without a slash at the end: [3] Mozilla/Tech/XPCOM/Reference/Components Currently, [1] redirects to [3], but they are actually two document. That is why the slug [1] needs to become slug [2] (and that is what I intended to do but did wrongly).
Flags: needinfo?(fscholz)
Comment 5•10 years ago
|
||
Something else strange has happened ... d = Document.objects.get(slug='Mozilla/Tech/XPCOM/Reference/Components/', locale='en-US') d2 = Document.objects.get(slug='Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile', locale='en-US') In [16]: d.slug Out[16]: 'Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile' In [17]: d2.slug Out[17]: u'Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile' So there's still an 'nsLocaleFile' in the database, and it won't let me move Components/ into it. Furthermore, https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile is still accessible. So what is triggering requests to Components/ ? If nothing, I can delete the erroneous Components/ doc.
Reporter | ||
Comment 6•10 years ago
|
||
Argh, sorry. 'nsDirectoryService' is the one not nsLocalFile. Although in/out [16] is still weird. https://developer.mozilla.org/admin/wiki/document/10791/ says: /en-US/docs/Mozilla/Tech/XPCOM/Reference/Components/ (nsDirectoryService) Which I interpret as: /slug/ (title)
Comment 7•10 years ago
|
||
Updated: In [1]: from kuma.wiki.models import Document In [2]: nsDirectoryService = Document.objects.get(slug='Mozilla/Tech/XPCOM/Reference/Components/', locale='en-US') In [3]: nsDirectoryService.slug Out[3]: u'Mozilla/Tech/XPCOM/Reference/Components/' In [4]: nsDirectoryService.slug = u'Mozilla/Tech/XPCOM/Reference/Components/nsDirectoryService' In [5]: nsDirectoryService.save() https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components/nsDirectoryService is now reachable. https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components/ seems to correctly redirect to https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Components though it doesn't seem to be correctly finding/showing the link to nsDirectoryService ?
Reporter | ||
Comment 8•10 years ago
|
||
The restoring of the document was successful. Thanks! Leaving this open to fix the actual problem of having the last character in the destination URL being a slash "/". We should not allow it.
Comment 9•10 years ago
|
||
I've submitted a PR that fixes this issue by removing the trailing slash if one is present in the slug: https://github.com/mozilla/kuma/pull/3176
Comment 10•10 years ago
|
||
Commits pushed to master at https://github.com/mozilla/kuma https://github.com/mozilla/kuma/commit/62f969077693482bbe85411c93dcb25095156e42 fix bug 1145580 Added check for trailing slash and a test for this fix. https://github.com/mozilla/kuma/commit/53df412ecabdb54bd966cd75f8236a47168f924e fix bug 1145580 - add info about what the slug rules are when moving pages. https://github.com/mozilla/kuma/commit/bbae237b0bd0591f313035ce2395f916a8970fc7 bug 1145580 - Update display of instructions list
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•