Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-62920

Uploading deleted user then adding to cohort gives fatal error

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL-62920-master
    • Hide

      Scenario 1:

      1. Create a cohort on your site
      2. Bulk upload users using: Test user upload.csv
      3. Complete the bulk upload setting 'Select for bulk user actions' to 'All users'
      4. In a new tab, go to Site administration -> Users -> Accounts -> Browse list of users and delete the user created
      5. Go back to the tab where you uploaded users, and with the selected users choose 'Add to cohort'
      6. Attempt to add the users to a cohort

      (A similar result would occur if instead of manually setting the 'deleted' field to 1, you deleted the user between the upload completing and selecting 'Add to cohort').

      Expected outcome:

      • The deleted user is ignored (and, if there had been any other users in the upload they would have been added to the cohort)

       

      Scenario 2:

      1. Log in as an admin
      2. Create a cohort on your site
      3. Go to Site administration > Users > Accounts > Bulk user actions 
      4. Add to selection at least two users 
      5. Go to Site administration > Users > Accounts > Browse list of users 
      6. Delete one of the users you added to selection 
      7. Go to Site administration > Users > Accounts > Bulk user actions again
      8.  Check deleted user is not selected anymore
      9. Select "With selected users... = Add to cohort" and click Go
      10. Choose a cohort and click on Add to cohort"
      11. Go to Site administration > Users > Accounts > Cohorts
      12. Click on cohort's Assign button
      13. Check deleted user is not there, and non deleted users are there

       

      Scenario 3:

      1. Log in as an admin
      2. Create a cohort on your site
      3. Go to Site administration > Users > Accounts > Bulk user actions 
      4. Add to selection at least two users 
      5. Open a new tab/window and go to Site administration > Users > Accounts > Browse list of users 
      6. Delete one of the users you added to selection 
      7. Go back to preview tab/window (Site administration > Users > Accounts > Bulk user actions)
      8. Deleted user should still be selected
      9. Select "With selected users... = Add to cohort" and click Go
      10. Choose a cohort and click on Add to cohort"
      11. Go to Site administration > Users > Accounts > Cohorts
      12. Click on cohort's Assign button
      13. Check deleted user is not there, and non deleted users are there

       

       

       

      Show
      Scenario 1: Create a cohort on your site Bulk upload users using:  Test user upload.csv Complete the bulk upload setting 'Select for bulk user actions' to 'All users' In a new tab, go to Site administration -> Users -> Accounts -> Browse list of users and delete the user created Go back to the tab where you uploaded users, and with the selected users choose 'Add to cohort' Attempt to add the users to a cohort (A similar result would occur if instead of manually setting the 'deleted' field to 1, you deleted the user between the upload completing and selecting 'Add to cohort'). Expected outcome: The deleted user is ignored (and, if there had been any other users in the upload they would have been added to the cohort)   Scenario 2: Log in as an admin Create a cohort on your site Go to Site administration > Users > Accounts > Bulk user actions  Add to selection at least two users  Go to Site administration > Users > Accounts > Browse list of users  Delete one of the users you added to selection  Go to Site administration > Users > Accounts > Bulk user actions again  Check deleted user is not selected anymore Select "With selected users... = Add to cohort" and click Go Choose a cohort and click on Add to cohort" Go to Site administration > Users > Accounts > Cohorts Click on cohort's Assign button Check deleted user is not there, and non deleted users are there   Scenario 3: Log in as an admin Create a cohort on your site Go to Site administration > Users > Accounts > Bulk user actions  Add to selection at least two users  Open a new tab/window and go to Site administration > Users > Accounts > Browse list of users  Delete one of the users you added to selection  Go back to preview tab/window (Site administration > Users > Accounts > Bulk user actions) Deleted user should still be selected Select "With selected users... = Add to cohort" and click Go Choose a cohort and click on Add to cohort" Go to Site administration > Users > Accounts > Cohorts Click on cohort's Assign button Check deleted user is not there, and non deleted users are there      

      1. Create a cohort on your site
      2. Bulk upload users using: Test user upload.csv
      3. Select 'Add new users' and complete the bulk upload
      4. In the database, set the 'deleted' field for the new user to 1
      5. Bulk upload the users again, but this time select 'Update existing users' and set 'Select for bulk user actions' to 'All users'
      6. After the upload is complete, with the selected users choose 'Add to cohort'
      7. Attempt to add the users to a cohort

      (A similar result would occur if instead of manually setting the 'deleted' field to 1, you deleted the user between the upload completing and selecting 'Add to cohort').

      Expected outcome:

      • The deleted user is ignored (and, if there had been any other users in the upload they would have been added to the cohort)

      Actual outcome:

      • Fatal error as line 69 of user_bulk_cohortadd.php only loads users who are not deleted, but does not check to see if a valid record has been returned, before trying to process it.

        1. MDL-62920.PNG
          75 kB
          Anna Carissa Sadia
        2. Test user upload.csv
          0.1 kB
          Davo Smith

            amaia Amaia Anabitarte
            davosmith Davo Smith
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.