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

Console errors, failure to move label questions in feedback activity

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80446-403
    • Hide
      1. Log in as admin
      2. Create a course
      3. Add a Feedback activity
      4. Turn Edit mode off
      5. View activity, press Edit questions
      6. Add two Short text answer questions
      7. Add a Label question
      8. Confirm each of the three questions has one single Move this question icon
      9. Confirm you can drag each question, and upon drop you see "Changes saved" notification
      Show
      Log in as admin Create a course Add a Feedback activity Turn Edit mode off View activity, press Edit questions Add two Short text answer questions Add a Label question Confirm each of the three questions has one single Move this question icon Confirm you can drag each question, and upon drop you see "Changes saved" notification

      This is a continuation of work from MDL-79512 and may have the same root cause/fix as MDL-80417 (however I can't reproduce that specific error, but can reproduce the same failure to drag/drop)

      You can see that the "Label" question type has two drag/drop handlers added to it on the following screenshot:

      Depending on which one you try to drag/drop with you would get a 50% chance of successful move, and 50% chance of triggering the following error:

      11:12:17.928 Uncaught DOMException: Node.insertBefore: The new child is an ancestor of the parent
          addHTML http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:15779
          _insert http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:18936
          insertBefore http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:18985
          drop_over_handler http://moodle.internal/master/theme/yui_combo.php?m/1702897854/mod_feedback/dragdrop/dragdrop-debug.js:97
          _notify http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13760
          notify http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13789
          _notify http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13452
          _procSubs http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13578
          fireComplex http://moodle.internal/master/theme/yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:27628
      yui_combo.php:15779
      

      The problem is this line is too loose, and matching the inner label content in the DOM as well as the expected outer node:

            pholden Paul Holden
            pholden Paul Holden
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Amaia Anabitarte Amaia Anabitarte
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.