[wp-trac] [WordPress Trac] #35031: wp_old_slug_redirect() in 4.4 redirecting existing posts

WordPress Trac noreply at wordpress.org
Wed Dec 16 08:59:00 UTC 2015


#35031: wp_old_slug_redirect() in 4.4 redirecting existing posts
-------------------------------------------------+-------------------------
 Reporter:  douglsmith                           |       Owner:  pento
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.4.1
Component:  Query                                |     Version:  4.4
 Severity:  critical                             |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by bobbingwide):

 Comments on 35031.diff. I can't see why you need to run another query
 (using get_posts()) to check the name of the post that has already been
 fetched. For me $wp_query already contains the required post.
 I would only expect another query to be run if this were not the case.

 There is another challenge though... without the new test the next query
 SELECT post_id FROM wp_postmeta, wp_posts WHERE ID = post_id AND post_type
 = 'fixture' AND meta_key = '_wp_old_slug' AND meta_value = 'huntercombe-
 gc'
 can return multiple results.

 Since there is no ordering then the ID that's returned could be different
 each time.
 This may lead to #35012.

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


More information about the wp-trac mailing list