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

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

av Itamar Tzadok -
Antall svar: 8

222+ and hence may be refactored away in 2.3, so just a note until I have the opportunity to test it on 2.3.

The break point is when section 0 is placed at the bottom rather than at the top. Items which are d&d from section 0 to other sections are copied rather than moved, that is, the sequence of section 0 is not adjusted. Items which are d&d from other sections into section 0 are duplicated in the (DB) sequence of section 0.

smiler

Gjennomsnittlig vurdering: -
Som svar til Itamar Tzadok

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

av Gareth J Barnard -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers

Dear Itamar,

I would suggest first doing a search in Moodle Tracker to see if this issue is known about and if not, then raise one.

Cheers,

Gareth

Som svar til Gareth J Barnard

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

av Itamar Tzadok -

Thanks Gareth but this issue doesn't seem to occur when section 0 is in it's standard top position and I don't want to bloat the tracker with for-the-time-being idiosyncratic behavior of a would-be contributed plugin. 

I think however that it is worth a note here because it suggests that there is a constraining assumption in the approach to the d&d of the course section modules. smiler  

Som svar til Itamar Tzadok

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

av Gareth J Barnard -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers

Ah ha!  This is a drag and drop interaction issue with your format.  Now makes sence as not at all clear in the first post.  Good luck with sorting it.

Cheers,

Gareth

Som svar til Gareth J Barnard

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

av Itamar Tzadok -

It's not an issue with my format but with the core implementation of the d&d (which may or may not resolve itself in 2.3). Originally I made section 0 in my format yet another section. HQ made a case for keeping it a distinct section and I decided to make the format comply with that. But contra to HQ I see no reason to constrain section 0 to top position and in my format it may by setting be placed below the displayed section. The core d&d should be able to handle that properly. smiler

Som svar til Itamar Tzadok

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

av Gareth J Barnard -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers

Ah ha, so it is only an issue with d&d in core when used with your format.  So therefore d&d breaks when using a situation outside the scope of known functionality.  So indeed as HQ are not aware of the requirement then I doubt that it would not be fixed in 2.3 unless by chance it was refactored to cope with such a situation or such desired functionality was implemented separately smiler

Cheers,

Gareth

Som svar til Gareth J Barnard

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

av Itamar Tzadok -

Precisely, and it would be a very good luck to find it resolved in 2.3. smiler

Som svar til Itamar Tzadok

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

av Dan Poltawski -
Hi Itamar,

A lot of work has been done on the drag and drop mechanics in 2.3 so it may well be resolved.

Although I can't quite understand from your posts what the issue is - could you explain what happens? I can try and see if its fixed.

thanks,
dan
Som svar til Dan Poltawski

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

av Itamar Tzadok -

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. smiler