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

Delete groupings while still attached to an activity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.5.4
    • Course, Groups
    • None
    • MOODLE_25_STABLE

      If a user deletes a grouping under a course that is still used by an activity, the application allows it.

      It then throws the warning:

      Notice: Undefined index: 57585 in lib/modinfolib.php on line 1801
      Notice: Trying to get property of non-object in lib/modinfolib.php
      on line 1801

      It also throws the warning (in the section):
      Notice: Undefined index: 65375 in course/renderer.php on line 725

      The lines in modinfolib.php:

      $this->_availableinfo = html_writer::tag('span', '(' . format_string(
      $groupings[$this->_groupingid]->name, true, array('context' => $context)) .
      ')', array('class' => 'groupinglabel'));

      Should check if the $this->_groupingid exists in the $groupings array.

      Same check needed for course/renderer.php

      But, this leaves orphaned groupings in mdl_course_modules:

      select * from mdl_course_modules where course = xxx and groupingid > 0;

      A check needs to also exist when deleting the groupings that they are not used in an activity.

            Unassigned Unassigned
            azrek G El-Zoghbi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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