Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#2071 closed defect (bug) (fixed)

some page gives 404 after reordering

Reported by: dissurion's profile 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)

2071.diff (2.1 KB) - added by davidhouse 19 years ago.

Download all attachments as: .zip

Change History (13)

#1 @dissurion
19 years ago

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

#2 @dissurion
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

#3 @davidhouse
19 years ago

This seems kinda weird. Could you create more test pages to check this rigidly?

#4 @dissurion
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 @dissurion
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.

#6 @davidhouse
19 years ago

Confirm. Only works when fancy permalinks are turned on. I'll look into it.

#7 @davidhouse
19 years ago

Sorry, the bug only happens when fancy permalinks are turned on. That was ambiguous.

#8 @davidhouse
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.

#9 @davidhouse
19 years ago

  • Keywords bg|has-patch added

Give this patch a try.

@davidhouse
19 years ago

#10 @ryan
19 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3356]) Fix page permalink 404 when pages are reordered. Props David House. fixes #2071

#11 @ryan
19 years ago

  • Milestone changed from 2.1 to 2.0

#12 @(none)
18 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.