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

Spaces in menu user profile field options break CSV user import.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.8
    • Fix Version/s: None
    • Component/s: User management
    • Labels:
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      There is a problem that does not let you upload users with a CSV file if there is a menu user profile field with spaces in the end/beginning of the menu options.

      There is 'first option ' option in menu field and the same value in CSV.

      username,profile_field_Dropdown
      tttt,first option 

      upload test.csv

      When you try to add users with a CSV file you get an error 'Invalid user field: {fieldname}' even if you have the same spaces in the values of the menu field in your CSV.

      If the system trims field values when you upload CSV it should also trim values when you create the list of allowed values.

      It is clear that there should be no spaces at all before or after options in menu profile field. In CSV should be no extra spaces as well. CSV values get trimmed though while menu options keep spaces in their options.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            андрейусков Андрей Усков
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: