Drag and drop activity to/from section 0 fails to clean-up

Re: Drag and drop activity to/from section 0 fails to clean-up

by Itamar Tzadok -
Number of replies: 0

Thanks Dan. No need to look into that just yet. This particular issue has disappeared from my dev so it may have been just a temporary miscommunication between the format and the course.

To clarify the observation, suppose two sections and a course module 123 that is moved between the sections. When section 0 is top position, no problem. But when section 0 is bottom position the sequence is not adjusted.

Starting point:

Section 1
Section 0
     - sequence: 123

Move 123 to section 1:

Section 1
     - sequence: 123
Section 0
     - sequence: 123

Move 123 back to section 0:

Section 1
Section 0
     - sequence: 123, 123

The point of this exercise is that since section 0 is by HQ definition a special section, it does not need to observe the normal order of sections.

I'll get back to that when I move to 2.3.

On a related note I opened MDL-33456 about moving sections failure when there are sections but course numsections is set to 0 (or any number lower than the destination section). The constraint is in move_section and move_section_to in course/lib.php (persists in 2.3dev) and if the moving-sections dnd refers to these functions to make the move it would fail too. smile