- Upgrade b2evolution 6.10.2-stable : Mysql Error everytime save and publish
- Password reset: Reset-Link links to a 403
#1 May 06, 2018 15:41
I have searched a name of a commenter.
In case I write "meggie" (lower case) I get an error message (
Warning: Division by zero in /blogs/inc/collections/_search.funcs.php on line 1015)
In case I write "Meggie" (first letter upper case) the search results work pretty.
So may be that the search has a case sensitive bug.
See fig. below.
#3 May 06, 2018 23:52
meggie works OK on this b2evo site and on my site which is 6.9.7 ?? http://calstock.org.uk
#4 May 07, 2018 09:29
because there is no commenter named "meggie". The bug happens only if you search a name of a person who commented a post and this person does really exist in you database (case sensitive).
#5 May 08, 2018 17:19
So it has to be a commenter, yet both your handle and mine start with a lower case and the search here is fine. Am I missing something else??
Is it the
_coll_search_form.widget.php you are using that calls the function or are you using some back office option that I don't know of?
#6 May 08, 2018 17:58
You*re right; using the widget everything works fine; the bug shows up using the search in bricks_skin in the header.
I have to figure out, how to fix this.
the line, mentioned in the error message
Warning: Division by zero in /blogs/inc/collections/_search.funcs.php on line 1015
does not show any bug (in my eyes)
$display_params['percentage'] = round( $row['score'] * $max_percentage / $max_score );
#7 May 08, 2018 20:57
As the code looks OK it must be the
$max_score as it's the only divisor.
Maybe you can you put an
echo $max_score before that line and a
die() command to see what the value is?
#8 May 08, 2018 21:14
It now works, What was the fix (in case it was not fixed accidentally ;-): I edited and saved the Skin bricks_skin and deleted the search widget and reinstalled the widget, erased the cashes and: now search works as it is expected to work.
#9 Jun 25, 2018 14:42
Hello @saunders, really we had a bug there because we used case-sensitive function, I have fixed this in a commit https://github.com/b2evolution/b2evolution/commit/ead18a90672adb5a1e5459cf1fd30e71df048cb8.
Thank you for the report.
#10 Jun 25, 2018 16:15
@yurabakhtin Thanks again for your great support. I fixed it.