Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#35368 closed defect (bug) (fixed)

Permalink structure not updating

Reported by: jerome281's profile jerome281 Owned by: swissspidy's profile swissspidy
Milestone: 4.5 Priority: normal
Severity: normal Version: 3.6
Component: Permalinks Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description

I've notice this issue on 2 WordPress sites running 4.4.1.
When you create a new page and select a sub sub parent page. The permalink doesn't seem to update matching the sub sub parent selected. Anyone have notice this issue?

Attachments (2)

35368.diff (462 bytes) - added by swissspidy 10 years ago.
35368.2.diff (1.6 KB) - added by swissspidy 10 years ago.

Download all attachments as: .zip

Change History (14)

#1 @swissspidy
10 years ago

  • Keywords reporter-feedback added

Can you give an example of how you set up your pages and what you expected vs. the actual permalinks?

I just did a quick local test with a few nested pages. After publishing the page all permalinks look correct (e.g. /parent-page/child-page/grand-child-page/great-grand-child-page/)

#2 follow-up: @jerome281
10 years ago

The page was not published but save as draft.

Following this example /parent-page/child-page/grand-child-page/

Let say create a page call "test" and select parent page "child-page" the permalink update to domain.com/parent-page/test instead of domain.com/parent-page/child-page/test

I hope it make more sense now.

@swissspidy
10 years ago

#3 in reply to: ↑ 2 @swissspidy
10 years ago

  • Keywords has-patch added; reporter-feedback removed
  • Milestone changed from Awaiting Review to 4.5

Replying to jerome281:

The page was not published but save as draft.

Following this example /parent-page/child-page/grand-child-page/

Let say create a page call "test" and select parent page "child-page" the permalink update to domain.com/parent-page/test instead of domain.com/parent-page/child-page/test

I hope it make more sense now.

Thanks. I know can reproduce and confirm this.

Not sure if this was caused by #35084, but it doesn't look like it. It seems to me the bug is that $page->post_name is empty in get_page_uri() because it gets reset when calling get_post(). The URI gets set to parent-page/child-page/, but get_sample_permalink() strips off /child-page.

35368.diff fixes the issue.

#4 follow-up: @ocean90
10 years ago

Previously: #12327/[14399]

#5 in reply to: ↑ 4 @swissspidy
10 years ago

Replying to ocean90:

Previously: #12327/[14399]

Interesting. Same approach as mine, just that the check was not as strict. That's why it was removed in [23208]. Can it be that this was broken ever since?

#6 follow-up: @ocean90
10 years ago

Not sure, I think there is another ticket about this, but haven't found it yet.

#7 in reply to: ↑ 6 @ocean90
10 years ago

Replying to ocean90:

Not sure, I think there is another ticket about this, but haven't found it yet.

#6619

#8 @swissspidy
10 years ago

  • Keywords needs-unit-tests added

@swissspidy
10 years ago

#9 @swissspidy
10 years ago

  • Keywords has-unit-tests added; needs-unit-tests removed

The added unit tests ensure that this will never happen again.

#10 @SergeyBiryukov
10 years ago

  • Keywords commit added

#11 @swissspidy
10 years ago

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

In 36253:

Permalinks: Ensure the page hierarchy is correct for sample permalinks.

Fixes #35368.

#12 @swissspidy
10 years ago

  • Version changed from 4.4.1 to 3.6
Note: See TracTickets for help on using tickets.