#2071 closed defect (bug) (fixed)
some page gives 404 after reordering
Reported by: | dissurion | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0 |
Component: | General | Keywords: | bg|has-patch |
Focuses: | Cc: |
Description
I've reordened a lot of nested test pages (most is 5 levels deep) and now I get a 404 on some of them. I can't lay my finger on a pattern though. When I reorder them again other pages have the 404 and not any more the reordered page. It al started when reordering a page with some childeren.
Attachments (1)
Change History (13)
#2
@
19 years ago
18 p 3 — b 4 — c 14 — — t 5 — te 10 — — ar 7 — — — in 8 — — — — so 11 — — — som 13 — — — — qs 12 — — — qsfd
#4
@
19 years ago
It's actually easy to reproduce:
create 3 pages all with no parent:
1 test1
2 test2
3 test3
next make test2 a subpage of test1
1 test1
2 - test2
3 test3
and now make test1 a subpage of test3
3 test3
1 - test1
2 --test2
The page id of test2 is higher than that of test1, but that of test one is lower than it's parent, test3.
Result: 404 for test2.
The pattern may be more complex if other cases are found, but so far those are the only times where I've got a 404.
#5
@
19 years ago
fuck it, edit:
It's actually easy to reproduce:
create 3 pages all with no parent:
1 test1 2 test2 3 test3
next make test2 a subpage of test1
1 test1 2 - test2 3 test3
and now make test1 a subpage of test3
3 test3 1 - test1 2 --test2
The page id of test2 is higher than that of test1, but that of test one is lower than it's parent, test3. Result: 404 for test2.
The pattern may be more complex if other cases are found, but so far those are the only times where I've got a 404.
#7
@
19 years ago
Sorry, the bug only happens when fancy permalinks are turned on. That was ambiguous.
#8
@
19 years ago
Tracked it down. The problem is in the rewrite rules: the rules for test3/test1/([/]+) for attachments appears before the rules for test3/test1/test2, so we get redirected and WP thinks we're looking for an attachment, name 'test2' on the page test3/test1. Working on a patch.
Think I've found the pattern: it gives a 404 for every page whose id is higher than it's parent when that parent has a smaller id than it's parent.
my setup for a page:
18 p
3 — b
4 — c
14 — — t
5 — te
10 — — ar
7 — — — in
8 — — — — so
11 — — — som
13 — — — — qs
12 — — — qsfd
the following pages give a 404: t, ar, so