[PHPBB3-16976] phpBB Native Search returns 1 match and one page of results

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
Post Reply
User avatar
P_I
Community Team
Community Team
Posts: 134
Joined: Fri Oct 31, 2014 4:56 am

[PHPBB3-16976] phpBB Native Search returns 1 match and one page of results

Post by P_I »

Apologies if this isn't the proper place to ask this question.

Boards that have updated to 3.3.7 have had their search functionality rendered essentially useless by this problem.

Thanks to quick efforts by rxu, [ticket/16976] Fix search results count by rxu · Pull Request #6374 · phpbb/phpbb exists and based on my offline testing fixes the problem. It hasn't been merged yet.

However given search on my boards is broken, I'm weighing patching my 3.3.7 installs with the code changes while awaiting a phpBB release containing the bugfix. Is there any reason to await a) the pull request being merged and/or b) proper inclusion of the bugfix in a phpBB release?

User avatar
david63
Registered User
Posts: 355
Joined: Mon Feb 07, 2005 7:23 am

Re: [PHPBB3-16976] phpBB Native Search returns 1 match and one page of results

Post by david63 »

P_I wrote: Sat Mar 26, 2022 8:19 pm b) proper inclusion of the bugfix in a phpBB release?
Unless there is a planned release to fix this bug then I would manually add the changes now.
P_I wrote: Sat Mar 26, 2022 8:19 pm Is there any reason to await a) the pull request being merged
Not if it works and I have tested it both on my test and live board without any problems.

I have just commented out the original lines so reversing would be easy, should it be necessary.
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
P_I
Community Team
Community Team
Posts: 134
Joined: Fri Oct 31, 2014 4:56 am

Re: [PHPBB3-16976] phpBB Native Search returns 1 match and one page of results

Post by P_I »

david63 wrote: Sun Mar 27, 2022 9:33 am I have tested it both on my test and live board without any problems.
Late last night (my time) I discovered that searching within a topic doesn't work correctly, returning "Search found 1 match" and a maximum of one page of posts returned. A back and forth with rxu confirmed the problem.

You might want to review the pull request again.

I'm currently testing a further refinement, so far so good.

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: [PHPBB3-16976] phpBB Native Search returns 1 match and one page of results

Post by 3Di »

I've never seen anyone ask that question before, especially not one from the phpBB team.

I think it's obvious what the answer is but I'll take a few seconds to reiterate.
If you believe the fix fixed the problem as you see it then simply apply it to your code, preserving the old parts so that you can restore order.

At worst you end up with another problem and relative, so you wouldn't have improved anything.

Don't expect a new version to be released in a few days as happened between 3.3.6 and 3.3.7, that was another matter, much more serious. :ugeek:
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

hrp402
Registered User
Posts: 2
Joined: Wed Apr 27, 2022 2:12 am

Re: [PHPBB3-16976] phpBB Native Search returns 1 match and one page of results

Post by hrp402 »

I can confirm that the "GROUP BY" in the SQL causes the COUNT to return multiple rows, each with a "total_results" value of 1. It needs to return one row with the count. You can fix this by summing the result of the query

e.g.

Code: Select all

$result = $this->db->sql_query("SELECT SUM(total_results) AS total_results FROM ({$sql_count}) cnt");
Last edited by hrp402 on Wed Apr 27, 2022 3:02 am, edited 1 time in total.

hrp402
Registered User
Posts: 2
Joined: Wed Apr 27, 2022 2:12 am

Re: [PHPBB3-16976] phpBB Native Search returns 1 match and one page of results

Post by hrp402 »

I have corrected this on my site with what I have above and the search is working as expected now.

Post Reply