Patch for "20.10_DEV" branch: https://reviews.mahara.org/12370

-- 
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/1958499

Title:
  Upload CSV Users Bug with Failed Emails

Status in Mahara:
  Fix Committed
Status in Mahara 20.10 series:
  New
Status in Mahara 21.04 series:
  New
Status in Mahara 21.10 series:
  New
Status in Mahara 22.04 series:
  Fix Committed

Bug description:
  Mahara: 21.10.0
  OS: Linux 20.04
  DB: Postgres
  Browser: n/a

  While implementing a customisation for a client, we identified a very
  old bug in htdocs/admin/users/uploadcsv.php.

  The setting of the `$failedusers` array on line 639 occurs within the
  foreach loop. Which means, the data in the $failedusers array gets
  reset after each iteration.

  The initialisation of $failedusers should occur outside of the foreach
  loop.

  
  
https://github.com/MaharaProject/mahara/blob/main/htdocs/admin/users/uploadcsv.php#L644-L667

  
  This is the current code at line 637:

  if ($values['emailusers'] && $addedusers) {
          foreach ($addedusers as $user) {
              $failedusers = array();
              try {
              ...

  It should be:

  if ($values['emailusers'] && $addedusers) {
          $failedusers = array();     <- MOVE outside the foreach loop
          foreach ($addedusers as $user) {
              try {
              ...

  
  Hope that makes sense.

  Thank you.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1958499/+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

Reply via email to