[buddypress-trac] [BuddyPress Trac] #5858: blog directory search returns incorrect result count
buddypress-trac
noreply at wordpress.org
Thu Sep 4 18:58:37 UTC 2014
#5858: blog directory search returns incorrect result count
--------------------------+-----------------------------
Reporter: jreeve | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version: 2.0
Severity: normal | Keywords:
--------------------------+-----------------------------
The results count on the blog search results page sometimes returns
results that are inconsistent with the actual number of returned results.
See some screenshots of this behavior in action at my bug report here:
https://github.com/mlaa/cbox-mla/issues/104. This is because, in
`BP_Blogs_Blog::get()` from `bp-blogs-classes.php`, the returned blog
summaries, `$paged_blogs`, searches blog names, while the results count of
the blogs, `$total_blogs`, searches both blog names and blog descriptions.
Thus, if there are, say, three blogs whose names contain "foo," but six
blogs whose descriptions (but not names) contain "foo," then a search for
"foo" would return three results, but the pagination display at the bottom
of the page would say "Viewing blog 1-9 (of 9 blogs)," which is untrue.
To fix this, there are two options: (1) tell the blog search to look for
its search terms in both the names and the descriptions of blogs, or (2)
tell the blog search counter not to look in blog descriptions. Although
(1) makes the blog search a little cooler, I can see how this wouldn't be
desirable, since there aren't usually blog descriptions that come back
from search results, and it could be confusing to users why there are
search results that don't seem to contain their search terms.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5858>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list