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

M.core.dialogue gets all mixed up

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.4, 2.6.1
    • Fix Version/s: 2.5.6, 2.6.3
    • Component/s: JavaScript
    • Labels:

      Description

      When one bit of code creates a dialogue, but doesn't show it, then another bit of code creates a dialogue and tries to show it - the M.core.dialogue can get them confused and the contents of one will overwrite the other.

      This occurs with Atto on the Add a rubric page. The delete criterion confirm dialogue does not display because it's content gets inserted to the wrong dom node.

      The problem is M.core.dialogue uses a COUNT variable to give each dialogue a unique id, but this fails sometimes, and gets reset to 0 - so there are 2 dialogues with COUNT == 0.

      A quick hack is:

      • COUNT++;
        + COUNT = Math.floor((Math.random()*10000)+1);

      from js/dialgoue.js

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14