Opened 16 years ago
Closed 16 years ago
#12327 closed defect (bug) (fixed)
Draft pages do not show parent pages in prospective URL
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 3.0 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Editor | Keywords: | has-patch tested |
| Focuses: | Cc: |
Description
When a draft page has a parent page set, its prospective URL does not reflect that, and instead the prospective URL will appear to be that of a top level page.
Expected:
Observed:
This was observed on 2.9.x as well, so is likely not a regression.
Attachments (1)
Change History (8)
#3
@
16 years ago
Just tested. It applies cleanly to current trunk though the line numbers have changed. When I applied the patch locally it worked with a notice about the line offset.
For my future reference: In situations like these, do we need a new diff or will the changeset figure it out like it did on my computer?
#4
@
16 years ago
Current is okay -- it's fine as long as it applies cleanly. We'll be applying it to our own testbeds exactly how you did.
Note: See
TracTickets for help on using
tickets.

get_page_uri (wp-includes/post.php, line 2910) is passed a page id and retrieves this page from DB, this retrieved page doesn't have post_name set if it's a draft. Hierarchy handling in get_sample_permalink (wp-admin/includes/post.php) assumes that the last part of the returned uri is the page's name, so the last portion of the parent path is replaced with %pagename%.
Fix allows get_page_uri to accept post object so that the temporary post_name set in get_sample_permalink can be used.