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

Upload users with datetime custom field doesn't validate data

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Testing instructions:

      1. Create custom profile field using datetime format (eg date of birth)
      2. Upload users from CSV with above field included, using YYYY-MM-DD format
      3. Upload succeeds
      4. View uploaded user profiles
        Expected: custom field displays correctly (eg 7 May 1984)
        Actual Result: custom field displays as 1-Jan-1970 (unix time 0)

      After applying patch:

      1. Upload users from CSV with field included.
      2. Upload succeeds
      3. View uploaded user profiles
        Result: custom field displays correctly (eg 7 May 1984)
      Show
      Testing instructions: Create custom profile field using datetime format (eg date of birth) Upload users from CSV with above field included, using YYYY-MM-DD format Upload succeeds View uploaded user profiles Expected: custom field displays correctly (eg 7 May 1984) Actual Result: custom field displays as 1-Jan-1970 (unix time 0) After applying patch: Upload users from CSV with field included. Upload succeeds View uploaded user profiles Result: custom field displays correctly (eg 7 May 1984)
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-mdl-38494

      Description

      When uploading users via csv, custom datetime fields are not validated or converted to the correct format for database storage. The field should be stored as a unix timestamp in the user_info_data table, but is stored as a text string instead.

      My patch adds preprocessing to the datetime profile field type.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13