Reviewed: https://reviews.mahara.org/6772 Committed: https://git.mahara.org/mahara/mahara/commit/7e05f9aafe6a947dc0765de604aef63071ae238b Submitter: Robert Lyon (robe...@catalyst.net.nz) Branch: 16.04_STABLE
commit 7e05f9aafe6a947dc0765de604aef63071ae238b Author: Aaron Wells <aar...@catalyst.net.nz> Date: Mon Jul 25 13:46:14 2016 +1200 Bug 1606094: Stop sending quota notifications to everyone This patch changes that bad left (outer) join to an inner join, so that we only check for notifications for users who are in the affected institution. As a further safeguard, it also removes the line that compared each user's file usage to the institution's new quota. Now, we'll instead compare each user's file usage to that user's current quota (which, for members of the institution, will be the institution's new quota.) Change-Id: I4db6068221d1238c8a755434e78e6cc006a84aa8 behatnotneeded: Test to come later (cherry picked from commit 2c262cdf8d3ddb8c9c66565c084b67e2f24825e6) -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1606094 Title: Changing the file quota for users in an institution, can send notifications to users in other institutions Status in Mahara: Fix Committed Status in Mahara 15.04 series: Fix Committed Status in Mahara 15.10 series: In Progress Status in Mahara 16.04 series: Fix Committed Status in Mahara 16.10 series: Fix Committed Bug description: On the institution config screen, there's a setting called "Update user quotas" that will do a one-time application of the institution's current "default quota" value to all existing users of the institution. At the same time, if you're using the "quota almost exceeded" notification emails, it will check each user whose quota has just been changed and send them a notification if they're near the threshold. The first part of this works fine. It does indeed update the quota for members of the changed institution, and nobody else. But there's a bug in the second part, that sends out the notifications. Instead of only checking the users in the institution, it checks *every* user in the site, and sends a notification to any of them who are near the threshold for the changed institution. This is not only annoying to users who aren't in the institution, but also confusing, because the email will tell them that their quota is the size of the changed institution's quota, when in fact their quota has not changed. To replicate: 1. Clean Mahara install 2. Log in as admin 3. Upload a 1MB file into your File -> Contents area 4. Create an institution. Save the institution. 5. Click the "edit" link for the institution. 6. Set "Default quota" to 100 Kilobytes. 7. Set "Update user quotas" to "On" 8. Click "Submit" Expected result: The admin user should not receive a notification, because they're not in that institution and their quota has not changed. Actual result: The admin user receives a notification about being over their quota, but their quota has not actually changed from the default 50MB. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1606094/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : mahara-contributors@lists.launchpad.net Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp