[wp-trac] [WordPress Trac] #35172: WordPress 4.4 pagination not working - Fix for 34060 broke backward compatibility

WordPress Trac noreply at wordpress.org
Sun Dec 20 14:08:58 UTC 2015


#35172: WordPress 4.4 pagination not working - Fix for 34060 broke backward
compatibility
--------------------------+-----------------------------
 Reporter:  bobbingwide   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  4.4
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The fix for #34060 has altered the result set obtained for those routines
 that were passing an `offset` value of `0` (zero).

 Whilst I agree that WP_Query should not ignore an offset of 0, I also feel
 that it should not ignore the value for 'paged' either.

 In my plugin I had basically the same code as that in get_posts() - which
 @westonruter commented on; a call to WP_Query::query with the value for
 offset defaulting to 0.

 === Current situation ===
 In 4.3.1 pagination only works when offset is 0 or null.
 If you set offset to any other value then pagination no longer works.

 In 4.4 pagination only works when offset is null.
 If you set offset to 0 or any other value then pagination no longer works.

 The question here is, what should the behaviour have been?

 What is the expected result sets for different values of `offset` and
 `paged`
 Particularly... should a 0 value for offset trump a non-zero value of
 paged?
 I think not, hence this TRAC.

 Determining the answer to this question will help us decide whether or not
 another fix should be developed to cater for all those plugins and themes
 that are still passing a value of 0 for offset.


 === Workaround ===
 I appreciate that I can easily change my code to eliminate the default
 value for offset. I will be releasing a quickfix to my referencing #34060
 and this new TRAC.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35172>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list