Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

Bug: Divide by zero error on user pages

0 votes

If you set all the points to zero, you get this error when viewing the user pages:

Warning: Division by zero in /path/qa-include/qa-page-user.php on line 393

Setting the fields "Per up/down vote on your question" and "Per up/down vote on your answer" to over 0 makes it go away.

asked May 16, 2011 in Q2A Core by DisgruntledGoat
edited May 16, 2011 by DisgruntledGoat

1 Answer

+1 vote
 
Best answer

Good catch! Actually this is due to some legacy code that can be completely removed, since it no longer serves any purpose.

You can remove these lines from qa-page-user.php:

$netvotesin=number_format... [long line]
if ($netvotesin>0)
  $netvotesin='+'.$netvotesin;

This will of course be fixed in the 1.4 beta.
answered May 17, 2011 by gidgreen