WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#15041 closed defect (bug) (fixed)

Page auto-draft & guid generation

Reported by: shawnparker Owned by:
Milestone: 3.1 Priority: highest omg bbq
Severity: critical Version: 3.0.1
Component: Permalinks Keywords: has-patch needs-testing
Focuses: Cc:

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)

page-auto-draft-fix.diff (925 bytes) - added by shawnparker 10 years ago.
REVISED auto draft fix for pages
page-auto-draft-fix.2.diff (806 bytes) - added by SergeyBiryukov 10 years ago.
Moved the check to the proper place

Download all attachments as: .zip

Change History (15)

@shawnparker
10 years ago

REVISED auto draft fix for pages

#1 @shawnparker
10 years ago

  • Cc shawnparker added

#2 @mrmist
10 years ago

  • Keywords has-patch needs-testing added; page auto-draft guid removed

#3 @westi
10 years ago

  • Milestone changed from Awaiting Review to 3.0.2

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

#5 @nacin
10 years ago

  • Milestone changed from 3.0.3 to 3.1

#6 @ryan
10 years ago

  • Milestone changed from 3.1 to Future Release

Punting all tickets that are not regressions in 3.1.

#7 @nacin
10 years ago

  • 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?

#8 @nacin
10 years ago

  • Priority changed from normal to highest omg bbq
  • Severity changed from major to critical

#9 @ryan
10 years ago

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

(In [17061]) Fix guid generation for page auto drafts. Props shawnparker. fixes #15041

#10 @TobiasBg
10 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.

@SergeyBiryukov
10 years ago

Moved the check to the proper place

#11 @SergeyBiryukov
10 years ago

Added new patch.

#12 @ryan
10 years ago

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

(In [17076]) Relocate isset check. Props TobiasBg, SergeyBiryukov. fixes #15041

#13 @westi
10 years ago

Great catch

Note: See TracTickets for help on using tickets.