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

Upload users with datetime custom field doesn't validate data

XMLWordPrintable

    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_25_STABLE
    • wip-mdl-38494
    • 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)

      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.

            rajeshtaneja Rajesh Taneja
            chrisw Chris Wharton
            Ankit Agarwal Ankit Agarwal
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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