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

M.core.dialogue gets all mixed up

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.5.6, 2.6.3
    • 2.5.4, 2.6.1
    • JavaScript

      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

            dobedobedoh Andrew Lyons
            damyon Damyon Wiese
            Damyon Wiese Damyon Wiese
            Dan Poltawski Dan Poltawski
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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