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

Custom user profile date fields incorrectly save date

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Set default timezone to UTC
      Set user timezone to Australia/Perth
      Add custom profile datetime field
      Edit profile, select date/time and save
      Check the display in View Profile matches what was saved.

      Show
      Set default timezone to UTC Set user timezone to Australia/Perth Add custom profile datetime field Edit profile, select date/time and save Check the display in View Profile matches what was saved.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-46676_master

      Description

      This is dependent on the server/PHP timezone being set to something other than UTC - in our case it was Australia/Perth
      1. Add a custom profile field for date only;
      2. Edit a user profile, select a date for the custom field and save;
      3. View the profile - the date will be a day earlier

      The issue lies in /user/profile/field/datetime/field.class.php edit_save_data_preprocess() method is using PHP date function rather than moodle's userdate function.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Sep/14