Moodle
  1. Moodle
  2. MDL-34647

Users enrolled via csv upload not subject to enrollment duration settings

    Details

    • Rank:
      43091

      Description

      If a course has a set manual enrolment method default duration and users are enrolled via the csv upload method, the enrolment duration has no effect on those students. They show as unlimited enrolment.

      Replication steps:
      */ Set the manual enrol method of a course to have a default enrol period of say, 60 days.
      */ Create a csv that will enrol a single user into that course.
      */ Process the csv.
      */ The user will be enrolled with no end date.

      1. enrol.csv
        0.0 kB
        Jason Fowler

        Issue Links

          Activity

          Hide
          Adam Olley added a comment -

          Related to MDL-34645 in that it is around default durations, but in a different area.

          Github links added. Thoughts Petr?

          Show
          Adam Olley added a comment - Related to MDL-34645 in that it is around default durations, but in a different area. Github links added. Thoughts Petr?
          Hide
          Michael de Raadt added a comment -

          This looks like it has come up previously, but was neglected. I will leave this issue open and tidy up the rest.

          Over to Petr to review this.

          Show
          Michael de Raadt added a comment - This looks like it has come up previously, but was neglected. I will leave this issue open and tidy up the rest. Over to Petr to review this.
          Hide
          Petr Škoda added a comment -

          submitting for integration, thanks

          Show
          Petr Škoda added a comment - submitting for integration, thanks
          Hide
          Dan Poltawski added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Sam Hemelryk added a comment -

          Thanks Adam, this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Adam, this has been integrated now
          Hide
          Jason Fowler added a comment -

          Users are still enrolled without an end date

          Show
          Jason Fowler added a comment - Users are still enrolled without an end date
          Hide
          Adam Olley added a comment - - edited

          Hi Jason,

          What data was in your CSV fields?
          What was the default enrolment field set to for the target courses manual enrol method?

          Show
          Adam Olley added a comment - - edited Hi Jason, What data was in your CSV fields? What was the default enrolment field set to for the target courses manual enrol method?
          Hide
          Jason Fowler added a comment -

          I've just attached the CSV file I used

          Show
          Jason Fowler added a comment - I've just attached the CSV file I used
          Hide
          Adam Olley added a comment -

          Hi Jason,
          That's not a valid moodle upload csv. I'm surprised the csv upload form didn't give you a "The CSV file is empty" error.

          At a minimum your csv needs to have the first row have the field name headers. Further the following are required fields:
          username, firstname, lastname, email

          For the purpose of this test, you'll then need the following optional fields:
          course1, role1

          You can read more in the docs here:
          http://docs.moodle.org/23/en/Upload_users

          Show
          Adam Olley added a comment - Hi Jason, That's not a valid moodle upload csv. I'm surprised the csv upload form didn't give you a "The CSV file is empty" error. At a minimum your csv needs to have the first row have the field name headers. Further the following are required fields: username, firstname, lastname, email For the purpose of this test, you'll then need the following optional fields: course1, role1 You can read more in the docs here: http://docs.moodle.org/23/en/Upload_users
          Hide
          Jason Fowler added a comment -

          Ah, okay, I was using a totally different method to enrol users then: http://docs.moodle.org/23/en/Flat_file

          using my method, the user was enrolled but the end date was not set.

          Maybe better testing instructions would have prevented this mistake.

          Show
          Jason Fowler added a comment - Ah, okay, I was using a totally different method to enrol users then: http://docs.moodle.org/23/en/Flat_file using my method, the user was enrolled but the end date was not set. Maybe better testing instructions would have prevented this mistake.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Oki, so at least this allowed us to discover that the enrol_flatfile_plugin is missing also the control of timeend (and probably others). Surely we would need to review that, comparing with users upload and make both perform the same way (new issue).

          Now let's try to test this via users csv upload...

          Show
          Eloy Lafuente (stronk7) added a comment - Oki, so at least this allowed us to discover that the enrol_flatfile_plugin is missing also the control of timeend (and probably others). Surely we would need to review that, comparing with users upload and make both perform the same way (new issue). Now let's try to test this via users csv upload...
          Hide
          Eloy Lafuente (stronk7) added a comment -

          I've created MDL-34811 about to fix any difference between enrol_flatfile and bulk upload users form CSV.

          Now testing the later here...

          Show
          Eloy Lafuente (stronk7) added a comment - I've created MDL-34811 about to fix any difference between enrol_flatfile and bulk upload users form CSV. Now testing the later here...
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Passing, course manual duration is applied ok.

          PS: One thing that surprised me a bit looking to code is that the duration specified in the CSV file has precedence over the duration defined in the course... divided thoughts here about that being the more correct behavior.

          Show
          Eloy Lafuente (stronk7) added a comment - Passing, course manual duration is applied ok. PS: One thing that surprised me a bit looking to code is that the duration specified in the CSV file has precedence over the duration defined in the course... divided thoughts here about that being the more correct behavior.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Fixed STOP Closed STOP Thanks STOP

          Yay, imagination! Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Fixed STOP Closed STOP Thanks STOP Yay, imagination! Ciao
          Hide
          Adam Olley added a comment -

          Hi Eloy,
          >PS: One thing that surprised me a bit looking to code is that the duration specified in the CSV file has precedence over the duration defined in the course... divided thoughts here about that being the more correct behavior.

          In my opinion at least, I'd say that's good behaviour. The duration set in the manual enrol method is the "default duration" to be applied in the absence of anything else saying otherwise. If we're specifying it in the csv I'd think that means I'm not interested in the courses default, and that I want that specified value.

          Show
          Adam Olley added a comment - Hi Eloy, >PS: One thing that surprised me a bit looking to code is that the duration specified in the CSV file has precedence over the duration defined in the course... divided thoughts here about that being the more correct behavior. In my opinion at least, I'd say that's good behaviour. The duration set in the manual enrol method is the "default duration" to be applied in the absence of anything else saying otherwise. If we're specifying it in the csv I'd think that means I'm not interested in the courses default, and that I want that specified value.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: