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

Role Assign always reset Enrolment Start & End Dates to 0 if RA exists

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0
    • 1.9.2
    • Enrolments
    • None
    • Linux Centos
    • MySQL
    • MOODLE_19_STABLE
    • MOODLE_20_STABLE

      I am using the CSV upload code to be able to use that via command line to import new users and assignments from csv with 10000+ users every day. I have found that each time I would re-run the script existing users from CSV file would have their Enrollment Start & End date reset to zero from non-zero.

      The reason is the role_assign function using the parameters of timestart and timeend defaulting to 0 if not passed from calling code. As I'm synchronizing Enrollment dates, I can't use that feature to set the RA dates.

      Hence I have modified the role_assign function to not set if zero is passed by timestart / timeend and non-zero values exist in the database.

      if ($timestart != 0)

      { $ra->timestart = round($timestart, -2); }

      if ($timeend != 0)

      { $ra->timeend = $timeend; }

            skodak Petr Skoda
            tlock Tim Lock
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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