Reviewed:  https://reviews.mahara.org/c/mahara/+/12648
Committed: 
https://git.mahara.org/mahara/mahara/commit/04d15a80a9b9d96031cecb52871b2447a8a60c6b
Submitter: "Robert Lyon <[email protected]>"
Branch:    22.04_DEV

commit 04d15a80a9b9d96031cecb52871b2447a8a60c6b
Author: Dianne Tennent <[email protected]>
Date:   Tue Apr 19 13:11:00 2022 +1200

Bug 1969385: Fix maximum number of allowed accounts

For 'No Institution' - prevent falsly returning true when
no limit applied

Change-Id: Ia24d9314b9b22def7730c998f8a05f9058bea662
(cherry picked from commit 64b5cc0d5199001530db4b638cc99d4c0087d409)

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1969385

Title:
  Fix maximum number of allowed accounts

Status in Mahara:
  Fix Committed

Bug description:
  On dev.mahara.org after putting the 22.04RC1 on it, I'm getting
  notifications that the maximum nubmer of accounts has been reached in
  'No instiutiton' even though that institution doesn't have an account
  limit.

  Robert investigated and found:

  This bit is wrong:

  ----
  /**
   * Returns true if the institution already has its full quota of users
   * assigned to it.
   *
   * @return bool
   */
  public function isFull() {
      return ($this->maxuseraccounts != '') && ($this->countMembers() >= 
$this->maxuseraccounts);
  }
  ---

  needs to be:   return (!empty($this->maxuseraccounts) && 
($this->countMembers() >= $this->maxuseraccounts);
  so that if $this->maxuseraccounts = null, or empty string or 0 it will return 
false (not full)
  currently if $this->maxuseraccounts  = 0 then it will go 0 is not an empty 
string and 0 is less than members (so is full)
  even though 0 is meant to represent unlimited people

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1969385/+subscriptions


_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to