#15041 closed defect (bug) (fixed)
Page auto-draft & guid generation
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | highest omg bbq | Milestone: | 3.1 |
| Component: | Permalinks | Version: | 3.0.1 |
| Severity: | critical | Keywords: | has-patch needs-testing |
| Cc: | shawnparker |
Description
Guid generation for pages is currently broken. auto-draft status is currently not handled and all page guids are simply the base site_url instead of site_url + ?page_id=000.
I looks as if auto-drafts were handled for posts here: http://core.trac.wordpress.org/changeset/14948
Attached is a patch for the _get_page_link() function in wp-includes/link-template.php to account for a post_status of auto-draft and properly generate the guid for pages (patch is to 3.0.1 tag, but issue exists in the same function in 3.0 branch and trunk as well).
Attachments (2)
Change History (15)
shawnparker — 3 years ago
comment:1
shawnparker — 3 years ago
- Cc shawnparker added
comment:4
shawnparker — 3 years ago
The change that patch wants to make to line 283 needs modification. I took that from the post permalink function and forgot to change $post_link to $link.
- Milestone changed from 3.1 to Future Release
Punting all tickets that are not regressions in 3.1.
- Milestone changed from Future Release to 3.1
Per IRC. This is a nasty bug for anyone using feeds in any regard for pages. Rare, but I'm sure someone does, perhaps for child pages or something.
Might we need to run an upgrade script to update old page GUIDs, too?
- Priority changed from normal to highest omg bbq
- Severity changed from major to critical
- Resolution set to fixed
- Status changed from new to closed
comment:10
TobiasBg — 2 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
For [17061]: The check for
isset($post->post_status)
in line 192 comes after $post->post_status has already been used to create $draft_or_pending in line 188, which is to late to avaid notices.
Thus, the check should be part of the $draft_or_pending conditional in line 188.
comment:11
SergeyBiryukov — 2 years ago
Added new patch.
comment:12
ryan — 2 years ago
- Resolution set to fixed
- Status changed from reopened to closed
comment:13
westi — 2 years ago
Great catch

REVISED auto draft fix for pages