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

Upload users throws 'undefined variable' warning for roles with no assignable roles

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites

      1. Developer debugging enabled

      Testing

      1. Create a new role "Demo role" with "demorole" shortname
        • Do not specify an archetype
        • Set "system" as a context
        • This role must have the "moodle/site:configview" and "moodle/site:uploadusers" capabilities allowed
      2. Create a new user and assign this role in system context
      3. Create a new course "Demo course" with "democourse" shortname
      4. Enable debug and display debug messages
      5. Log out
      6. Log in as the user who was assigned Demo role
      7. Navigate to Site administration => Users => Upload user
      8. Upload the attached CSV
      9. Press "Upload users" to preview
      10. Press "Upload users" to upload the users
        1. Confirm that no errors were shown
      Show
      Prerequisites Developer debugging enabled Testing Create a new role "Demo role" with "demorole" shortname Do not specify an archetype Set "system" as a context This role must have the "moodle/site:configview" and "moodle/site:uploadusers" capabilities allowed Create a new user and assign this role in system context Create a new course "Demo course" with "democourse" shortname Enable debug and display debug messages Log out Log in as the user who was assigned Demo role Navigate to Site administration => Users => Upload user Upload the attached CSV Press "Upload users" to preview Press "Upload users" to upload the users Confirm that no errors were shown
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65654-master

      Description

      When uploading users and current user role has no assignable roles a warning about undefined variable 'rolecache' is shown with debugging on.

        Attachments

          Activity

            People

            • Assignee:
              danielneis Daniel Neis Araujo
              Reporter:
              danielneis Daniel Neis Araujo
              Peer reviewer:
              Marina Glancy
              Integrator:
              Andrew Nicols
              Tester:
              Andrew Nicols
              Participants:
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Jul/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 50 minutes
                50m