History | Log In     View a printable version of the current page.  
We are currently focused especially on Moodle 2.0, Moodle 1.9.x bugs and Moodle 1.9.x testing.    Confused? Lost? Please read this introduction to the Tracker.
Issue Details (XML | Word | Printable)

Key: MDL-11539
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Nicolas Connault
Reporter: Chris Potter
Votes: 4
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Moodle

AJAX Shifting of Blocks Incorrect - Movement doesn't match DB activity

Created: 02/Oct/07 04:35 AM   Updated: 07/Jul/08 01:32 PM
Component/s: AJAX
Affects Version/s: 1.8, 1.8.1, 1.8.2
Fix Version/s: None

File Attachments: 1. Text File section_moving.patch (1 kb)
2. Text File section_moving_including_ajax_callbacks.patch (4 kb)

Environment:
Windows Server 2003 (32 and 64-bit)
Apache 2.2, IIS6
PHP 5.2.2
Issue Links:
Cloners
 
Dependency
 
Relates
 

URL: http://moodle.westshore.edu
Participants: Chris Potter, Nicklas Lindgren, Nicolas Connault and Steve Bond
Security Level: None


 Description  « Hide
When AJAX is enabled globally (and in the user profile), when a section is moved from one area to another, instead of seeing the intended behavior of having the sections below shift down one to make room for the moved section, the section being moved seems to take on the value of the old section and the old section takes the value of the dropped section. In the database, they simply switch values. This causes much confusion to users in the interface when trying to re-arrange sections in the course. It just seems to be a misunderstanding of what should be happening between the AJAX interface (which appears to update correctly, as sections are shifted properly), and the database (which switches values between blocks being modified instead of changing them to reflect what's happening in AJAX). Hopefully this makes a little sense. If you need access to test this on our server, please contact me and we'll arrange it. I don't know how isolated this problem is, but because of the lack of it seeming to be widely known, I suspect it's something in my installation (which has no customizations to the AJAX interface or anything relating to section movement). Block movements are fine also.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Chris Potter - 02/Oct/07 08:29 PM - edited
I should probably clarify also that the sections are the middle column, NOT the blocks on the left and/or right side of the page and that we're using Moodle 1.8.2.

Nicklas Lindgren - 09/Oct/07 09:07 PM
The move_section function in course/lib.php is only designed to swap adjacent sections.

I've attached a patch that makes it behave correctly.

Chris Potter - 15/Oct/07 10:16 PM - edited
I've had a little luck... now it works (almost) as expected. Now, if I drop an item onto another (ex: topic 5 onto topic 2), the one I'm moving shows it taking the place of topic 2, but in the database gets set to the one BELOW topic 2.

Nicklas Lindgren - 17/Nov/07 06:49 AM
AJAX movement and backend database movement work the same for me. I tested, amongst other things, moving topic 5 onto topic 2 a number of times.

There are related problems that might cause confusion though, see MDL-11675.

I realized that the code i'm testing with contains some additional changes that might be pertinent. I've made the changes to the page layout to occur only after the AJAX request is successfully completed.

I'm attaching a patch with all the related changes included.

Steve Bond - 15/Feb/08 08:03 PM
Just a note to say that this problem persists in 1.9 (tested on 1.9 beta 4)

Steve Bond - 20/Feb/08 03:10 AM
I've been testing Nicklas' patches on 1.9, and still I'm seeing some odd behaviour. For example, I had numbered sections ordered as follows:

1,3,4,2,5

I dragged section 2 and dropped it between 1 and 3. The immediate effect was to change to this order:

2,3,1,4,5

The I clicked reload, and suddenly I had this:

1,5,3,2,4

Which is just baffling.

I've had a good look at Nicklas' section-moving patch and it seems OK to me, but I'm clueless about Ajax so I'm guessing that's where the problem lies...

Nicolas Connault - 07/Jul/08 01:32 PM
Please disregard this issue (and its patches), it is a clone of MDL-12198, which has a working patch assigned for 1.9 and HEAD.