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

Moving resources with AJAX into sections that contain UL tags in the summary

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.3
    • 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4
    • JavaScript
    • None
    • NA
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_23_STABLE

      When moving resources by drag and drop, there is a strange behavior if the summary of the section contains ul tags. The problem comes from the fact that the resources_ul is identified as the first ul in the content_td. The fix consists of finding the first ul which has a classname of section and use it as the resources_ul.

      This snippet shows the place where the problem comes from as well as the proposed fix.

      In file /lib/ajax/section_classes.js
      In function section_class.prototype.process_section

      Line 139:
      // Find/edit resources
      //this.resources_ul = this.content_td.getElementsByTagName('ul')[0];

      // Fix:
      var all_uls = this.content_td.getElementsByTagName('ul');
      i = 0;
      while (i < all_uls.length) {
      if (all_uls[i].className == 'section')

      { this.resources_ul = all_uls[i]; break; }

      i++;
      }

            poltawski Dan Poltawski
            pjermann Patrick Jermann
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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