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

Child course tries to identify deleted meta course, resulting in an error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.4.7, 2.5.3
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as admin
      2. Enable the Meta course sync enrolment plugin at Site admin > Plugins > Enrolment > Manage enrol plugins
      3. Create a new course with no enrolments
      4. Enable Meta course sync enrolments for the course at Course admin > Users > Enrolment methods
      5. Link the course to a parent (meta) course with users already enrolled
      6. Check the list of enrolments in the child course at Site admin > Users > Enrolled users
      7. Delete the parent course at Site admin > Courses > Add/edit courses > (category)
      8. Check the list of enrolments in the child course again
      9. Check the enabled enrolment methods at Course admin > Users > Enrolment methods
      10. No notice or warning should appear.
      11. Enrolment details should show id of deleted course.
      Show
      Log in as admin Enable the Meta course sync enrolment plugin at Site admin > Plugins > Enrolment > Manage enrol plugins Create a new course with no enrolments Enable Meta course sync enrolments for the course at Course admin > Users > Enrolment methods Link the course to a parent (meta) course with users already enrolled Check the list of enrolments in the child course at Site admin > Users > Enrolled users Delete the parent course at Site admin > Courses > Add/edit courses > (category) Check the list of enrolments in the child course again Check the enabled enrolment methods at Course admin > Users > Enrolment methods No notice or warning should appear. Enrolment details should show id of deleted course.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      wip-mdl-41590
    • Sprint:
      BACKEND Sprint 4

      Description

      Using the Meta course sync enrolment method, if a parent course is deleted, the enrolments in the child course remain, but are disabled and roles are removed (under default settings).

      The problem is that, even when the enrolment is disabled, when the list of enrolments is shown it attempts to include the name of the (now deleted) parent course, and fails, resulting in an error...

      Notice: Trying to get property of non-object in D:\xampp\htdocs\master_integration\lib\moodlelib.php on line 9487
      

      This error also appears on the page showing the enrolment methods (Course admin > Users > Enrolment methods).

      There should probably be a check in both places before including the name of the parent course.

      There is no way to link the child course to another course without deleting the Meta course sync enrolment method and then adding it again.

      Replication steps:

      1. Log in as admin
      2. Enable the Meta course sync enrolment plugin at Site admin > Plugins > Enrolment > Manage enrol plugins
      3. Create a new course with no enrolments
      4. Enable Meta course sync enrolments for the course at Course admin > Users > Enrolment methods
      5. Link the course to a parent (meta) course with users already enrolled
      6. Check the list of enrolments in the child course at Site admin > Users > Enrolled users
      7. Delete the parent course at Site admin > Courses > Add/edit courses > (category)
      8. Check the list of enrolments in the child course again
      9. Check the enabled enrolment methods at Course admin > Users > Enrolment methods

      Expected result: Details of the recently delete parent course will not be shown

      Actual result: No details are shown, but the page tries to show the name of the parent course and ends up producing an error.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

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