Moodle

AJAX drag and drop is broken for topic sections

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.6
  • Component/s: AJAX
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

I'm having trouble working out exactly what is going on here, but in my course, I have 15 sections each with about 3 items and can not move them about without causing mayhem.

If I move 11 onto 7 it makes them swap, instead of inserting 11 in between 7 and 6. Next time I do the same with the new 11 and 7, it works OK. Arranging all of them into a different order (5 operations, firebug shows no AJAX problems), then refreshing the page leaves me with a mess.

I've made a test course to illustrate (attached) which has the topic labels numbered so that initially, section 1 is labelled 1, 2 is labelled 2 etc. This lets you know the original order.

To see the mess, arrange the topics so that they go 1 3 5 7 9 2 4 6 8 10 by dragging 1,2,5,7 & 9 up onto 2 one by one. Then refresh. I ended up with 1 3 5 7 9 6 4 8 2 10.

Issue Links

Activity

Hide
Matthew Davidson added a comment -

AJAX drag and drop for sections is almost completely broken. If you move a section by leapfroging another section (move section 3 to the 1 spot), and then refresh the page, it is wrong.

Also...a bug I fixed a while back has re-reared its head. The date should change as you drag and drop. This needs fixed VERY promptly.

http://tracker.moodle.org/browse/MDL-6892

Show
Matthew Davidson added a comment - AJAX drag and drop for sections is almost completely broken. If you move a section by leapfroging another section (move section 3 to the 1 spot), and then refresh the page, it is wrong. Also...a bug I fixed a while back has re-reared its head. The date should change as you drag and drop. This needs fixed VERY promptly. http://tracker.moodle.org/browse/MDL-6892
Hide
Nicolas Connault added a comment -

I've attached a patch that fixes this in HEAD. It won't be difficult to backport to 1.9, so please provide some feedback so I can go ahead and finally fix this.

Show
Nicolas Connault added a comment - I've attached a patch that fixes this in HEAD. It won't be difficult to backport to 1.9, so please provide some feedback so I can go ahead and finally fix this.
Hide
Nicolas Connault added a comment -

Attached the patch for 1.9

Show
Nicolas Connault added a comment - Attached the patch for 1.9
Hide
Eloy Lafuente (stronk7) added a comment -

Addressing it to 1.9.2... important enough IMO. Thanks, Nico!

Show
Eloy Lafuente (stronk7) added a comment - Addressing it to 1.9.2... important enough IMO. Thanks, Nico!
Hide
Nicolas Connault added a comment -

No one has reviewed the patch, but I'm pretty confident it's good, so applying now.

Show
Nicolas Connault added a comment - No one has reviewed the patch, but I'm pretty confident it's good, so applying now.
Hide
Nicolas Connault added a comment -

Merged to HEAD

Show
Nicolas Connault added a comment - Merged to HEAD
Hide
Jerome Mouneyrac added a comment - - edited

Firefox3/LAMP-Moodle 1.9 Stable: drag and drop work fine but when I refresh the page, the new order has not been saved.

Show
Jerome Mouneyrac added a comment - - edited Firefox3/LAMP-Moodle 1.9 Stable: drag and drop work fine but when I refresh the page, the new order has not been saved.
Hide
Jerome Mouneyrac added a comment -

same problem on HEAD

Show
Jerome Mouneyrac added a comment - same problem on HEAD
Hide
Nicolas Connault added a comment -

Fixed again

Show
Nicolas Connault added a comment - Fixed again
Hide
Jerome Mouneyrac added a comment -

Same test result as last time: Firefox3/LAMP-Moodle 1.9 Stable: drag and drop work fine but when I refresh the page, the new order has not been saved.
Sorry Nico, I feel like evil with this issue

Show
Jerome Mouneyrac added a comment - Same test result as last time: Firefox3/LAMP-Moodle 1.9 Stable: drag and drop work fine but when I refresh the page, the new order has not been saved. Sorry Nico, I feel like evil with this issue
Hide
Jerome Mouneyrac added a comment - - edited

In fact I kind of understand why, my course is Weekly format !

I changed for Topics format, and in this case all works fine.

However for Weekly format something is not consistent. Either the teacher should not be allowed to drag and drop, either the change should be saved.
Even if it doesn't make sens, I prefer the second solution. I think the teacher should be allowed to drag and drop a week before another one if he really wants to do it.

Show
Jerome Mouneyrac added a comment - - edited In fact I kind of understand why, my course is Weekly format ! I changed for Topics format, and in this case all works fine. However for Weekly format something is not consistent. Either the teacher should not be allowed to drag and drop, either the change should be saved. Even if it doesn't make sens, I prefer the second solution. I think the teacher should be allowed to drag and drop a week before another one if he really wants to do it.
Hide
Wen Hao Chuang added a comment -

Hi Jerome, I tested this again but I couldn't really reproduce what you experienced. I created a weekly format course, then drag and drop from week 5 to week 1 (to week 0 area will NOT work, btw). Initially the "date" will not be changed on the fly, so week 1 area is still showing the week of week 5 time frame, however, after I refresh this page, the the date range (of week1) show up correctly. I tested this with the latest 1.9.4+ build (20090316) on a typical LAMP stack testing server.

By the way I noticed that when you are moving the whole "sections" using AJAX, you don't see the hinted line about where it will be landed. However if you are moving the "resources" then you (most of the time) will see the hinted line about where it will be landed. Is this considered as part of the consistency issue?

I noticed that Petr updated this ticket on 22/Jan/09 with target fix version 1.9.5, is there any recent update about this? Is there a changeset/patch available that we could help out testing? Thanks!

Show
Wen Hao Chuang added a comment - Hi Jerome, I tested this again but I couldn't really reproduce what you experienced. I created a weekly format course, then drag and drop from week 5 to week 1 (to week 0 area will NOT work, btw). Initially the "date" will not be changed on the fly, so week 1 area is still showing the week of week 5 time frame, however, after I refresh this page, the the date range (of week1) show up correctly. I tested this with the latest 1.9.4+ build (20090316) on a typical LAMP stack testing server. By the way I noticed that when you are moving the whole "sections" using AJAX, you don't see the hinted line about where it will be landed. However if you are moving the "resources" then you (most of the time) will see the hinted line about where it will be landed. Is this considered as part of the consistency issue? I noticed that Petr updated this ticket on 22/Jan/09 with target fix version 1.9.5, is there any recent update about this? Is there a changeset/patch available that we could help out testing? Thanks!
Hide
Jerome Mouneyrac added a comment -

Thanks Wen for your explanation. In fact it does work as you say. I think the date should be updated on the fly, otherwise it is confusing. If this behaviour is not going to be fixed, Nico can close the issue.

Show
Jerome Mouneyrac added a comment - Thanks Wen for your explanation. In fact it does work as you say. I think the date should be updated on the fly, otherwise it is confusing. If this behaviour is not going to be fixed, Nico can close the issue.
Hide
Nicolas Connault added a comment -

This is actually fixed. The date issue is a separate bug: MDL-20415

Show
Nicolas Connault added a comment - This is actually fixed. The date issue is a separate bug: MDL-20415

Dates

  • Created:
    Updated:
    Resolved: