Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-36465

Drag and drop a section to general section causes JS error

    Details

    • Testing Instructions:
      Hide
      • Open a course with multiple sections
      • Turn editing on
      • Attempt to drag section 1 to section 2
        • Confirm that all section titles were updated
        • Confirm that the section was moved by JS
      • Reload the page
        • Confirm that the section was still moved
      • Attempt to drag section 2 to section 1
        • Confirm that all section titles were updated
        • Confirm that the section was moved by JS
      • Reload the page
        • Confirm that the section was still moved
      • Attempt to drag a section to the last position
        • Confirm that all section titles were updated
        • Confirm that the section was moved by JS
      • Reload the page
        • Confirm that the section was still moved
      • Attempt to drag section 1 to section 0 (General)
        • Confirm that it was not possible to drop on 0
        • Confirm that dropping anyway didn't do anything
      Show
      Open a course with multiple sections Turn editing on Attempt to drag section 1 to section 2 Confirm that all section titles were updated Confirm that the section was moved by JS Reload the page Confirm that the section was still moved Attempt to drag section 2 to section 1 Confirm that all section titles were updated Confirm that the section was moved by JS Reload the page Confirm that the section was still moved Attempt to drag a section to the last position Confirm that all section titles were updated Confirm that the section was moved by JS Reload the page Confirm that the section was still moved Attempt to drag section 1 to section 0 (General) Confirm that it was not possible to drop on 0 Confirm that dropping anyway didn't do anything
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-36465-master

      Description

      When trying to drag and drop a section, in place of the general section, a javascript error occurs and the lightbox containing the loading icon is never hidden.

      Replication steps:

      1. Log in as admin/password
      2. Navigate to a course with existing activities
      3. Turn editing on
      4. Wait for page to reload
      5. Drag a lower section over section 0 (the top section) and release it

      Expected result: Either the section should move to become section 0 or the move should not be possible.

      Actual result: The section is allowed to be dropped on section 0, but the move does not complete. The loading icon appears and the section is blurred. On reloading, the moved section is restored to its original location. The following JS error is given.

      TypeError: node is null
      http://michael.moodle.local/moodle_master_test_mysql/theme/yui_combo.php?moodle/1352347236/course/dragdrop/dragdrop.js
      Line 105
      

      Line 105 is...

      return Number(node.get('id').replace(/section-/i, ''));
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  7 Vote for this issue
                  Watchers:
                  12 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Nov/13