Projects ⇒ Bugs ⇒ #590: Warning line 55: Division by zero in block-Survey.php ⇒ CPG Dragonfly™ CMS
Bug #590 Warning line 55: Division by zero in block-Survey.php
Project: Dragonfly 9.0.3 -> 9.3 Category: Blocks
Submitted: Friday, July 15, 2005 (17:19:27) Modified: Saturday, November 26, 2005 (23:35:30)
Status: Closed Assigned to:
PHP Version: 4.3.10 HTTPD Server: Apache 2.0

View/Vote Add Comment

by: Pitcher
You get this error on every answer that is not voted on
by: Pitcher
This seems to happend only when you edit the vote and remove some of the answers that have been voted on.
by: Biggles
Line 55 of block/block-Survey.php should be:

$percent = 0;
if($sum) {
$percent = 100 / $sum * $option['option_count'];
by: xfsunoles
Alternative Fix is
$percent = ($sum) ? 100 / $sum * $option['option_count'] : 0;
by: DJMaze
This bug has been fixed in the CVS.

Snapshots of the sources are packaged every 6 hours; this change
will be in the next snapshot. You can grab the snapshot at the
Downloads section.

Thank you for the report, and for helping us to make CPG-Nuke 9.0.3 -> 9.1 better.
User Info

Welcome Anonymous


Support for DragonflyCMS in a other languages: