Automattic / Automattic/jetpack
Infinite scroll allowed vars are combined in a way which replaces rather than merges
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
I noticed while debugging a site using infinite scroll that some query args being posted from js were not being applied, specifically `post__in` and `post__not_in`, in this case. The method used here to combine the public and private query vars using `+=` means that some of the array values are replaced rather than added:-
https://github.com/Automattic/jetpack/blob/374f9afcb435e9480463dba7959fa408a68c4672/projects/plugins/jetpack/modules/infinite-scroll/infinity.php#L1501
Would this be better if it was changed to use `array_merge`?
Contributor guide
Research direction
Start in projects/plugins/jetpack/modules/infinite-scroll/infinity.php around line 1501 and inspect how the public and private query vars are combined. Reproduce the infinite-scroll request with post__in and post__not_in, then verify that both sets of values remain present after the change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100