getting quotausedpercent can cause 'divide by zero' error

Bug #1393584 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Robert Lyon

Bug Description

If we set a user's quota to 0 it throws an error:

[WAR] bb (admin/users/edit.php:356) Division by zero
Call stack (most recent first):

    log_message("Division by zero", 8, true, true, "/home/robertl/htdocs/mahara-devel/mahara/htdocs/ad...", 356) at /home/robertl/htdocs/mahara-devel/mahara/htdocs/lib/errors.php:439
    error(2, "Division by zero", "/home/robertl/htdocs/mahara-devel/mahara/htdocs/ad...", 356, array(size 7)) at /home/robertl/htdocs/mahara-devel/mahara/htdocs/admin/users/edit.php:356

Normally we wouldn't be setting a user's quota to 0 - but for automated tests this can make sense.

So it is useful to fix for that reason.

Noticed when running webservices phpunit tests

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3986

Son Nguyen (ngson2000)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3986
Committed: http://gitorious.org/mahara/mahara/commit/f6ff1d28aa11bf78932aa08dc84d7eb027f423ad
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit f6ff1d28aa11bf78932aa08dc84d7eb027f423ad
Author: Robert Lyon <email address hidden>
Date: Tue Nov 18 11:43:44 2014 +1300

Quota percent 'divide by zero' error (Bug 1393584)

Change-Id: I252c5f763ccc83d846f5dcc7fd086d723b31e2e6
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.