Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 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
-
Fix Version/s: None
-
Component/s: AJAX
-
Labels:None
-
Environment:NA
-
Affected Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Description
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++;
}
The issue still exists in 1.9 and the development version.
The fix proposed by Patrick works in principle. Another css class has been added to the ul elements in question so a slight update is needed. A patch is provided.