Ticket #1222 (closed defect: fixed)

Opened 2 years ago

Last modified 21 months ago

Search - Relevant Post Links Broken

Reported by: hpguru Owned by: chrishajer
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

search.php.diff Download (974 bytes) - added by Gautam Gupta 2 years ago.
Basic patch, can be improved upon.
search.php.2.diff Download (928 bytes) - added by GautamGupta 23 months ago.
Do not limit posts nor order by time
1222.diff Download (493 bytes) - added by GautamGupta 22 months ago.
A simple patch for the second problem

Change History

  • Summary changed from Search no work good to Search - Relevant Post Links Broken

To replicate this bug:

  1. On fresh installation create a new topic. Title being "Lorem ipsum", and content being "Debug search".
  2. 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.

  • Keywords has-patch, needs-testing, search added; Search removed
  • Severity changed from normal to major

Error verified. Attaching patch, which can be improved upon.

Basic patch, can be improved upon.

  • Owner set to chrishajer
  • Status changed from new to assigned
  • Keywords has-patch needs-testing added; has-patch, needs-testing, search removed

Do not limit posts nor order by time

  • Keywords tested added; needs-testing removed

I think the search.php.2.diff would work good.

  • 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.

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:

  1. http://bbpress.org/forums/search.php?q=topic
  2. http://bbpress.org/forums/search.php?post_text=topic&forum_id=0

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"

I've experienced the bug with Kakumei too; the search form also loses its styling, since its id changes.

A simple patch for the second problem

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.

Works perfectly, great work! We can close this ticket.

  • 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?

  • 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...

  • Status changed from closed to reopened
  • Resolution fixed deleted

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.

  • 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

Note: See TracTickets for help on using tickets.