[wp-trac] [WordPress Trac] #20419: get_sample_permalink() passes the wrong post_status to wp_unique_post_slug()

WordPress Trac noreply at wordpress.org
Tue May 17 02:53:17 UTC 2016


#20419: get_sample_permalink() passes the wrong post_status to
wp_unique_post_slug()
--------------------------+---------------------------
 Reporter:  mintindeed    |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  4.6
Component:  Permalinks    |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):

 * milestone:  Future Release => 4.6


Comment:

 I spent some time with this ticket tonight and here's where we are :-D

 [attachment:20419.4.diff] contains the changes necessary to change the
 function signature of `wp_unique_post_slug()` so that the second parameter
 is `$post`. This includes the changes to `wp_unique_post_slug()` itself,
 changes to the places in core where we use the function, and modifications
 to our unit tests to avoid notices.

 My one misgiving about the change in [attachment:20419.4.diff] is that I
 don't want to start throwing zillions of deprecated notices for plugins
 using `wp_unique_post_slug()` in the old way. However, I'm halfway through
 crawling the plugins repo for uses of `wp_unique_post_slug()`, and it
 looks like it's not actually used very often at all.

 Other than that, I think the changes in [attachment:20419.4.diff] are
 unproblematic, and should go into 4.6 either way.

 The second attachment is [attachment:20419.5.diff]. This contains what's
 left of the patch: the change to `wp_unique_post_slug()` so that 'draft'
 and 'pending' are no longer excluded from the uniqueness checks; the
 changes to `get_sample_permalink()`; and the necessary changes to unit
 tests. I'll need some more time to think about how and whether these
 changes are the right kind of fix for the issue described in this ticket.

 There was some stuff in [attachment:20419.3.diff] that I left out. Most
 notably, there was a modification related to #30910. Not sure if that was
 supposed to be there, but it's not directly related to this ticket, so
 I've left it out.

 @mintindeed - Could I ask you to do the following:

 1. Look over [attachment:20419.4.diff] to make sure I've covered all the
 bases related to changing the function signature
 2. Now that [attachment:20419.5.diff] has distilled your fixes to a couple
 of easy-to-read lines, let me know if you still think they're the right
 approach (it's possible that I've missed something out of the larger
 earlier patch, too).

 Putting this into the 4.6 milestone for further review.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/20419#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list