[wp-trac] [WordPress Trac] #35172: WordPress 4.4 pagination not working - Fix for 34060 broke backward compatibility
WordPress Trac
noreply at wordpress.org
Mon Dec 21 02:32:23 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 | Resolution:
Keywords: reporter-feedback close | Focuses:
-------------------------------------+------------------------------
Changes (by boonebgorges):
* keywords: => reporter-feedback close
Comment:
The central problem in #34060 was that the interaction between 'offset'
and 'paged' was inconsistent: For `offset=0`, `paged` was taking
precedence; for all other values of `offset`, `offset` was taking
precedence. It seems like the prior design decision here (by "prior" I
mean "whenever 'paged' and 'offset' were added to `WP_Query`) was that
`offset` ought to take precedence, and the fact that it did not do so in
the case of `0` was an oversight. [34697] and [35417] were meant to
correct this.
> 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.
Should I take away from this comment that (a) you think that it should be
the other way around, and `paged` should always take precedence over
`offset`? Or perhaps (b) that `offset` and `paged` should somehow work
together? What other way is there for `WP_Query` to recognize `offset=0`
while respecting `paged` at the same time?
Regarding "backward compatibility": Anytime we fix a bug, we are breaking
backward compatibility with someone who was exploiting the bug as a
feature. It sounds to me like this is a case where you, and possibly
others, were exploiting the fact that `offset=0` behaved abnormally. In
cases like this, there's no perfect solution, but I think on balance it
may be better to ask the few who are using the parameter in an odd way to
update their usage, so that the API becomes more transparent to new
developers. But perhaps I am missing some nuance of how `paged` and
`offset` could be used together.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35172#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list