Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#15041 closed defect (bug) (fixed)

Page auto-draft & guid generation

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

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 16 years ago.
REVISED auto draft fix for pages
page-auto-draft-fix.2.diff (806 bytes ) - added by SergeyBiryukov 16 years ago.
Moved the check to the proper place

Download all attachments as: .zip

Change History (15)

@shawnparker
16 years ago

REVISED auto draft fix for pages

#1 @shawnparker
16 years ago

  • Cc shawnparker added

#2 @mrmist
16 years ago

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

#3 @westi
16 years ago

  • Milestone Awaiting Review3.0.2

#4 @shawnparker
16 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
16 years ago

  • Milestone 3.0.33.1

#6 @ryan
16 years ago

  • Milestone 3.1Future Release

Punting all tickets that are not regressions in 3.1.

#7 @nacin
16 years ago

  • Milestone Future Release3.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
16 years ago

  • Priority normalhighest omg bbq
  • Severity majorcritical

#9 @ryan
16 years ago

  • Resolutionfixed
  • Status newclosed

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

#10 @TobiasBg
16 years ago

  • Resolution fixed
  • Status closedreopened

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
16 years ago

Moved the check to the proper place

#11 @SergeyBiryukov
16 years ago

Added new patch.

#12 @ryan
16 years ago

  • Resolutionfixed
  • Status reopenedclosed

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

#13 @westi
16 years ago

Great catch

Note: See TracTickets for help on using tickets.