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

Allow theme field in bulk Upload users tool

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Setup
      1. Create a CSV file with fields: username, firstname, lastname, email, password, theme.
        • Note 1: username, firstname, lastname, email at least are mandatory fields
        • Note 2: provide passwords to prevent CRON having to send a newly generated password
        • Note 3: Valid theme names are "boost" and "classic". Add entries with invalid theme names too (e.g. 'clean', 'more')
          Sample CSV:

          username,password,firstname,lastname,email,theme
          student1,P@ssw0rd!,Tom,Jones,jonest@example.com,boost
          student2,P@ssw0rd!,Trent,Reznor,reznor@example.com,classic
          student3,P@ssw0rd!,Troy,Barnes,troy@greendale.com,
          student4,P@ssw0rd!,Donald,Barnes,donald@greendale.com,clean
          

      User themes disabled.
      1. Log in as admin.
      2. Go to "Site administration / Appearance / Themes / Theme settings"
      3. Make sure "Allow user themes" (allowuserthemes) is disabled
      4. Go to the upload users tool ("Site administration / Users / Accounts / Upload users")
      5. Upload your CSV file.
      6. Confirm that you see "User themes are not enabled, so any included in the upload users file will be ignored." in the Status column of the "Upload users preview" page.
      7. Press "Upload users"
      8. Confirm that the users have been uploaded (indicated by the "New user" text under the Status column)
      9. Confirm that you also see "User themes are not enabled, so any included in the upload users file will be ignored." in the Status column of the "Upload users results"
      10. Log in as any of the uploaded users.
      11. Confirm that your theme is set to the default theme (e.g. Boost).
      User themes enabled.
      1. Log in as admin.
      2. Go to "Site administration / Appearance / Themes / Theme settings"
      3. Tick "Allow user themes" (allowuserthemes).
      4. Save the changes.
      5. Go to the upload users tool ("Site administration / Users / Accounts / Upload users")
      6. Upload your CSV file.
      7. Check the "Status" column on the "Upload users preview" (Since you're uploading the same file, you'll see "Duplicate address" as well)
      8. Confirm that you see "No theme is defined for this user." for student3
      9. Confirm that you see "Theme "clean" is not installed and will be ignored." for student4
      10. Under the "Upload type", select "Add new and update existing users".
      11. Set "Existing user details" to "Override with file"
      12. Press "Upload users"
      13. On the "Upload users results" page, confirm that the users student1 and student2 have been updated (indicated by the "User updated" text under the Status column).
      14. Just like in the "Upload users preview" page, confirm that you see "No theme is defined for this user." for student3
      15. Confirm that you also see "Theme "clean" is not installed and will be ignored." for student4
      16. Log in as student1/3/4.
      17. Confirm that your theme is set to the default theme (e.g. Boost).
      18. Log in as student2.
      19. Confirm that your theme is set to Classsic.
      Show
      Setup Create a CSV file with fields: username, firstname, lastname, email, password, theme. Note 1: username, firstname, lastname, email at least are mandatory fields Note 2: provide passwords to prevent CRON having to send a newly generated password Note 3: Valid theme names are " boost " and " classic ". Add entries with invalid theme names too (e.g. ' clean ', ' more ') Sample CSV: username,password,firstname,lastname,email,theme student1,P@ssw0rd!,Tom,Jones,jonest@example.com,boost student2,P@ssw0rd!,Trent,Reznor,reznor@example.com,classic student3,P@ssw0rd!,Troy,Barnes,troy@greendale.com, student4,P@ssw0rd!,Donald,Barnes,donald@greendale.com,clean User themes disabled. Log in as admin. Go to " Site administration / Appearance / Themes / Theme settings " Make sure "Allow user themes" (allowuserthemes) is disabled Go to the upload users tool (" Site administration / Users / Accounts / Upload users ") Upload your CSV file. Confirm that you see " User themes are not enabled, so any included in the upload users file will be ignored. " in the Status column of the " Upload users preview " page. Press " Upload users " Confirm that the users have been uploaded (indicated by the " New user " text under the Status column) Confirm that you also see " User themes are not enabled, so any included in the upload users file will be ignored. " in the Status column of the "Upload users results" Log in as any of the uploaded users. Confirm that your theme is set to the default theme (e.g. Boost). User themes enabled. Log in as admin. Go to " Site administration / Appearance / Themes / Theme settings " Tick "Allow user themes" (allowuserthemes). Save the changes. Go to the upload users tool (" Site administration / Users / Accounts / Upload users ") Upload your CSV file. Check the "Status" column on the " Upload users preview " (Since you're uploading the same file, you'll see " Duplicate address " as well) Confirm that you see " No theme is defined for this user. " for student3 Confirm that you see " Theme "clean" is not installed and will be ignored. " for student4 Under the " Upload type ", select " Add new and update existing users ". Set " Existing user details " to " Override with file " Press " Upload users " On the " Upload users results " page, confirm that the users student1 and student2 have been updated (indicated by the " User updated " text under the Status column). Just like in the " Upload users preview " page, confirm that you see " No theme is defined for this user. " for student3 Confirm that you also see " Theme "clean" is not installed and will be ignored. " for student4 Log in as student1/3/4. Confirm that your theme is set to the default theme (e.g. Boost). Log in as student2. Confirm that your theme is set to Classsic.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_30_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-44484-master

      Description

      Hi,

      I need to change the theme used by some of my users.

      I found it handy to use the Upload users tool adding a theme column in my csv.

      In order for the Upload users tool to accept my csv, I needed to add the 'theme' field inside the /admin/tool/uploadusers/index.php file.

      Could you please consider to make this change permanent ?

      If user themes are enabled, then the Upload users tool should accept a csv with the 'theme' field.

      Thanks a lot,
      Philippe

        Attachments

        1. MDL-44484-column header.png
          63 kB
          Luca Bösch
        2. Screenshot_1.png
          225 kB
          Janelle Barcega
        3. Screenshot_2.png
          101 kB
          Janelle Barcega
        4. user upload.txt
          0.1 kB
          Luca Bösch

          Activity

            People

            • Votes:
              7 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/May/19

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 5 hours, 6 minutes
                2d 5h 6m