[wp-trac] [WordPress Trac] #29663: next_post_link & previous_post_link Category exclude broken

WordPress Trac noreply at wordpress.org
Thu Nov 6 20:06:39 UTC 2014


#29663: next_post_link & previous_post_link Category exclude broken
-------------------------------+---------------------------
 Reporter:  gabrieldiggs       |       Owner:  boonebgorges
     Type:  defect (bug)       |      Status:  accepted
 Priority:  normal             |   Milestone:  4.0.1
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  template
-------------------------------+---------------------------
Changes (by boonebgorges):

 * owner:  wonderboymusic => boonebgorges
 * status:  assigned => accepted


Comment:

 This appears to be a problem related to shared terms. I'm guessing that
 gabrieldiggs also has a tag called 'News'. This would explain why
 wonderboymusic was unable to reproduce.

 The problem was introduced in [29248] #22112. The `excluded_terms`
 subquery was rewritten to use a subquery (which is correct) but checks
 against `term_taxonomy_id`, when it should be checking against `term_id`.
 On test installations with no shared terms (or in the unit tests, without
 some fiddling), `term_id` and `term_taxonomy_id` match, which is why no
 one noticed this problem during testing. Once those numbers are offset,
 the bug rears its head.

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


More information about the wp-trac mailing list