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

uploaduser.php fails when custom profile field that is not required exists

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-78417-403
    • Hide
      1. Log in as admin
      2. Navigate to Users > Accounts > User profile fields in site administration
      3. Create a new Drop down menu field
        • Short name: menu
        • Name: Menu
        • Is this field required: No
        • Menu options:

          Cat
          Dog
          Wolf
          

        • Default value: <empty>
      4. Run the following commands from a terminal:

        $ cd admin/tool/uploaduser/cli
        $ php uploaduser.php --file=../example.csv
        

      5. Confirm you do not see "Value for argument --profile_field_menu is not valid."
      6. Confirm you see the following in the output:

        Users created: 3
        Users having a weak password: 0
        Errors: 0
        

      Show
      Log in as admin Navigate to Users > Accounts > User profile fields in site administration Create a new Drop down menu field Short name: menu Name: Menu Is this field required: No Menu options: Cat Dog Wolf Default value: <empty> Run the following commands from a terminal: $ cd admin/tool/uploaduser/cli $ php uploaduser.php --file=../example.csv Confirm you do not see "Value for argument --profile_field_menu is not valid." Confirm you see the following in the output: Users created: 3 Users having a weak password: 0 Errors: 0

      admin/tool/uploaduser/cli/uploaduser.php fails when custom profile field that is not required exists

      • To reproduce add a custom profile checkbox field. Make it not required.

      Then when you try to upload user csv file uploaduser.php reports an error:

      Value for argument --profile_field_customfield is not valid. Allowed values: 0, 1

      I also tried adding a "profile_field_customfield " column with a value of "0" to my csv but it still fails with the same error.

      Here is csv data:

      "username","firstName","lastName","email"
      "fieldtest","fieldtest","fieldtest","fieldtest@fieldtest.au"

       

      The value is "not required" so why am I being forced to set the value ????

       

       

            pholden Paul Holden
            tux Colin G
            Stevani Andolo Stevani Andolo
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 34 minutes
                1h 34m

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