Skip to:
Content

bbPress.org

Opened 17 years ago

Closed 16 years ago

#1222 closed defect (bug) (fixed)

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 (3)

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

Download all attachments as: .zip

Change History (21)

#1 @hpguru
17 years ago

  • Summary Search no work good → Search - Relevant Post Links Broken

#2 @matveb
17 years ago

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.

#3 @Gautam Gupta
17 years ago

  • Keywords has-patch needs-testing search added; Search removed
  • Severity normal → major

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

@Gautam Gupta
17 years ago

Basic patch, can be improved upon.

#4 @chrishajer
17 years ago

  • Owner set to chrishajer
  • Status new → assigned

#5 @GautamGupta
17 years ago

  • Keywords search removed

@GautamGupta
17 years ago

Do not limit posts nor order by time

#6 @GautamGupta
17 years ago

  • Keywords tested added; needs-testing removed

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

#7 @chrishajer
17 years ago

  • Resolution → fixed
  • Status assigned → closed

(In [2414]) Fix Relevant Post links in search results. Fixes #1222. Props GautamGupta

#8 @mr_pelle
16 years ago

  • Resolution fixed
  • Status closed → reopened

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.

#9 @Markus Pezold
16 years 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:

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

#10 @mr_pelle
16 years 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"

#11 @mr_pelle
16 years ago

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

@GautamGupta
16 years ago

A simple patch for the second problem

#12 @GautamGupta
16 years 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.

#13 @mr_pelle
16 years ago

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

#14 @chrishajer
16 years ago

  • Resolution → fixed
  • Status reopened → closed

(In [2429]) Reported by mr_pelle. Patch in 2414 broke relevant search results. Fixes #1222. Props GautamGupta

#15 @mr_pelle
16 years ago

  • Severity major → 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...

#16 @mr_pelle
16 years ago

  • Resolution fixed
  • Status closed → reopened

#17 @mr_pelle
16 years 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.

#18 @GautamGupta
16 years ago

  • Resolution → fixed
  • Severity critical → major
  • Status reopened → closed

Yes, you're right. I've opened a new ticket for this - #1274

Note: See TracTickets for help on using tickets.