Ticket #1222 (closed defect: fixed)
Search - Relevant Post Links Broken
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 1.0.3 |
| Component: | Back-end | Version: | 1.0.2 |
| Severity: | major | Keywords: | has-patch tested |
| Cc: |
Description
Search has a bug. Some posts links broken! http://bbpress.org/forums/topic/search-relevant-post-links-broken
Attachments
Change History
- Summary changed from Search no work good to Search - Relevant Post Links Broken
To replicate this bug:
- On fresh installation create a new topic. Title being "Lorem ipsum", and content being "Debug search".
- Then search for "debug". The created topic should appear both under "Recent Posts" and "Relevant posts".
Result: the topic link for the second result --under "Relevant posts"-- should be set incorrectly without any id.
The bug, I believe, comes form search.php and only occurs for topics under "Relevant posts" when they have already been displayed on "Recent posts". If you erase the $bb_query_form->BB_Query_Form in search.php for $recent = $bb_query_form->results; the topic link under "Relevant posts" works fine.
So there is some overlapping in the queries when fetching the same post both times which renders the second link without an id.
comment:3
Gautam Gupta — 2 years ago
- Keywords has-patch, needs-testing, search added; Search removed
- Severity changed from normal to major
Error verified. Attaching patch, which can be improved upon.
comment:5
GautamGupta — 2 years ago
- Keywords has-patch needs-testing added; has-patch, needs-testing, search removed
comment:6
GautamGupta — 23 months ago
- Keywords tested added; needs-testing removed
I think the search.php.2.diff would work good.
comment:7
chrishajer — 23 months ago
- Status changed from assigned to closed
- Resolution set to fixed
(In [2414]) Fix Relevant Post links in search results. Fixes #1222. Props GautamGupta?
- Status changed from closed to reopened
- Resolution fixed deleted
I found a new bug, consequence of this patch:
To replicate this bug: 1. Make a search. 2. Make the same search.
Result: no results shown.
This happens because search form id changed from topic-search-form to post-search-form.
comment:9
Markus Pezold — 22 months ago
I can't replicate this bug on my own customized theme (Scoun). After the first test I go around to my test-forum with many other themes - For me it seems the bug is only in themes with two different search-forms!
The second search changes the url-param:
comment:10
mr_pelle — 22 months ago
Yes, the url-param changes, and that's what breaks the search. I've also found out that a third search completes correctly... o_0"
comment:11
mr_pelle — 22 months ago
I've experienced the bug with Kakumei too; the search form also loses its styling, since its id changes.
comment:12
GautamGupta — 22 months ago
The problem was that when we changed the relevant search's type to post, $bb_query_form->type was also changed to it and the bb_topic_search_form() function uses that to determine what name should be given to the form, which created the problem.
I have attached the patch which would fix this problem.
comment:13
mr_pelle — 22 months ago
Works perfectly, great work! We can close this ticket.
comment:14
chrishajer — 22 months ago
- Status changed from reopened to closed
- Resolution set to fixed
(In [2429]) Reported by mr_pelle. Patch in 2414 broke relevant search results. Fixes #1222. Props GautamGupta?
comment:15
mr_pelle — 21 months ago
- Severity changed from major to critical
Last patch broke something huge: now every search I make returns me every post in the forum! =P I didn't know if to open a new ticket, because this new bug is caused by this ticket's last patch...
comment:17
mr_pelle — 21 months ago
Little correction: if you select a forum to search into, search returns all the posts in that forum. If not (i.e. Any is selected), search returns all the posts in your forum.
comment:18
GautamGupta — 21 months ago
- Status changed from reopened to closed
- Resolution set to fixed
- Severity changed from critical to major
Yes, you're right. I've opened a new ticket for this - #1274
