WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#24237 closed defect (bug) (duplicate)

Draft Pages Missing Parent Slug In Permalink

Reported by: lucasstark Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Editor Keywords: has-patch
Focuses: administration Cc:

Description

Draft pages are missing the direct parent's slug as part of the permalink. When the page is published it does receive the correct full permalink.

To reproduce:

Create a new page.
Select a parent.
Save draft ( do not publish yet ).
Review the permalink that is displayed. It will be missing the parent slug.

Add New Page:
http://f.cl.ly/items/3P2H022E1z0O0J21111t/Screen%20Shot%202013-05-01%20at%208.08.11%20AM.png

After Draft is Saved:
http://f.cl.ly/items/0x2f060v2H2y0E14023K/Screen%20Shot%202013-05-01%20at%208.08.30%20AM.png

The permalink should include "contact" at this point. It will not until it is published.

Attachments (1)

24237.patch (425 bytes) - added by chriseverson 6 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
7 years ago

Previously reported in #13932.

#2 @ethitter
7 years ago

  • Cc erick@… added

#3 @SergeyBiryukov
7 years ago

  • Component changed from General to Permalinks

#4 @kiaseven
6 years ago

Hi,

We are seeing this issue on one of our sites after a recent upgrade to version 3.8.1. Any chance there is a fix on its way or am I echoing into the ether?

Thanks,

Kia

#5 @SergeyBiryukov
6 years ago

  • Keywords needs-patch added

@chriseverson
6 years ago

#6 @chriseverson
6 years ago

  • Keywords has-patch added; needs-patch removed

Slugs aren't saved on drafts until the post is either published or the slug is manually updated. To display the sample permalink, we temporarily generate a post_name then pass the object through get_page_uri( ), however once it hits get_page_uri(), the function then pulls a fresh copy of the WP_Post object from the database, which was overwriting the temporary post_name value. This patch resolves that issue while still allowing get_page_uri() to accept either a WP_Post object or ID.

#7 @iseulde
6 years ago

  • Component changed from Permalinks to Editor
  • Focuses administration added
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #6619.

Note: See TracTickets for help on using tickets.