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

Duplicate entries calling get_records in guess_end

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: Analytics
    • Labels:
    • Testing Instructions:
      Hide

      Set up

      1. Login as teacher in a course with topics format and without course end date
      2. Follow Course administration ► Users ► Enrolment methods.
      3. Enable 'Self enrolment (Learner)' method.
      4. Login as student and self-enrol in this course.
      5. Login as teacher.
      6. Follow Course administration ► Users ► Enrolled users.
      7. Enrol manually same student.
      8. At this point, in the participants page, this student will have 2 enrolment methods assigned.

      Testing

      1. Execute 'php admin/tool/analytics/cli/guess_course_start_and_end.php --guessall --update'.
      2. You SHOULD NOT get any PHP error.

       

      Show
      Set up Login as teacher in a course with topics format and without course end date Follow Course administration ► Users ► Enrolment methods. Enable 'Self enrolment (Learner)' method. Login as student and self-enrol in this course. Login as teacher. Follow Course administration ► Users ► Enrolled users. Enrol manually same student. At this point, in the participants page, this student will have 2 enrolment methods assigned. Testing Execute 'php admin/tool/analytics/cli/guess_course_start_and_end.php --guessall --update'. You SHOULD NOT get any PHP error.  
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60718-master

      Description

      When some participant is enrolled to a course with more than one methods (for instance first auto-enrolment and after manual), the following error appears when executing 'php admin/tool/analytics/cli/guess_course_start_and_end.php --guessall --update':

       

      Course2 (id = 3): 
      Current start date is good: Monday, 6 November 2017, 8:36 PM
      Can't guess the end date
      ++ Did you remember to make the first column something unique in your call to get_records? Duplicate value '1509616171' found in column 'timeaccess'. ++
      * line 802 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
      * line 363 of /analytics/classes/course.php: call to pgsql_native_moodle_database->get_records_sql()
      * line 172 of /admin/tool/analytics/cli/guess_course_start_and_end.php: call to core_analytics\course->guess_end()
      * line 101 of /admin/tool/analytics/cli/guess_course_start_and_end.php: call to tool_analytics_calculate_course_dates()

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sarjona Sara Arjona (@sarjona)
                Reporter:
                sarjona Sara Arjona (@sarjona)
                Peer reviewer:
                Damyon Wiese
                Integrator:
                David Monllaó
                Tester:
                David Monllaó
                Participants:
                Component watchers:
                Elizabeth Dalton, David Monllaó, Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17