diff -u b/project_issue.install b/project_issue.install --- b/project_issue.install +++ b/project_issue.install @@ -747,23 +747,23 @@ } /** - * Migrate users with notifications >= 50 projects to a per-user setting. + * Migrate users with notifications for >= 50 projects to a global setting. * * Since there never used to be a way to say "Send me e-mail notifications * for my own issues for all projects" many users have had to select this * option individually on a large number of projects. If a user is subscribed * to 50 or more projects at this notification level, remove all of those - * per-project settings and just set their per-user default. + * per-project settings and just set their per-user global default. */ function project_issue_update_6010() { $ret = array(); // Find all the users with 50 or more projects configured to send e-mail for - // PROJECT_ISSUE_NOTIFICATION_OWN. + // "own issues". $uids = array(); - $query = db_query("SELECT uid, COUNT(nid) project_count FROM {project_issue_notification_project} WHERE level = %d GROUP BY uid HAVING project_count >= 50", PROJECT_ISSUE_NOTIFICATION_OWN); - while ($account = db_fetch_object($query)) { - $uids[] = $account->uid; + $result = db_query("SELECT uid, COUNT(nid) AS project_count FROM {project_issue_notification_project} WHERE level = %d GROUP BY uid HAVING project_count >= 50", PROJECT_ISSUE_NOTIFICATION_OWN); + while ($uid = db_result($result)) { + $uids[] = $uid; } if (!empty($uids)) {