#8633 closed defect (bug) (fixed)
Pagination broken in `BP_Blogs_Blog::get()`
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 10.1.0 | Priority: | normal |
| Severity: | major | Version: | 10.0.0 |
| Component: | Blogs | Keywords: | has-patch |
| Cc: |
Description
In #8488, date queries were added for the blogs component. Also some refactoring was done to the blogs stack so we could pass an array instead of multiple function arguments.
There is a bug during the refactoring that broke pagination when fetching the blogs loop (apologies!). For large sites, this can cause timeouts on the Sites Directory.
In BP_Blogs_Blog::get(), the "per page" argument was previously $limit, while in bp_blogs_get_blogs(), the "per page" argument is $r['per_page']. When swapping to the function array, $r['limit'] doesn't exist, which caused no pagination 😅
I've attached a patch, which fixes this issue.
Attachments (1)
Change History (6)
#2
@
4 years ago
I'm just wondering if you missed a $limit replacement in the bp_blogs_get_random_blogs() function, could you look at it.
Ahh, yes. I did miss this replacement. Will add it in when I commit it.
Hi @r-a-y thanks a lot for your patch, it looks good, I'm just wondering if you missed a
$limitreplacement in thebp_blogs_get_random_blogs()function, could you look at it. Otherwise, it's good to be committed to me 👍