Opened 2 years ago

Last modified 4 months ago

#16843 new defect (bug)

wp_unique_post_slug() doesn't check pagination base when CPT has archive

Reported by: scribu Owned by:
Priority: normal Milestone: 3.6
Component: Post Types Version: 3.1
Severity: minor Keywords: has-patch 3.3-early
Cc:

Description

Title says it all.

Attachments (4)

16843.diff (3.1 KB) - added by scribu 2 years ago.
test-16843.php (262 bytes) - added by scribu 2 years ago.
16843.2.diff (3.1 KB) - added by scribu 2 years ago.
formatting
16843.3.diff (3.0 KB) - added by wonderboymusic 4 months ago.

Download all attachments as: .zip

Change History (14)

scribu2 years ago

scribu2 years ago

16843.diff has the added bonus that it avoids an unnecessary query, if any of the preceding conditions match.

For better readability of the code, please add logical operators (mostly || in your patch) to the front of the line so it's easier to read how lines are in relation to each other.

scribu2 years ago

formatting

That does look better.

  • Milestone changed from Awaiting Review to 3.1

What's the actual code change here? Just the final block of code, checking the pagination base?

  • Milestone changed from 3.1 to 3.2

You did mean 3.2, right?

The added line is indeed in the final block:

|| ( $post_type_obj->has_archive && $wp_rewrite->pagination_base == $slug )
  • Version set to 3.1

You probably meant to set the version, but I'll leave the milestone also.

  • Severity changed from normal to minor

comment:8   ryan2 years ago

  • Keywords 3.3-early added

Punting per bug scrub.

comment:9   ryan2 years ago

  • Milestone changed from 3.2 to Future Release
  • Milestone changed from Future Release to 3.6

Patch refreshed so it applies cleanly against trunk

Note: See TracTickets for help on using tickets.