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

NS_ERROR_UNEXPECTED with TinyMCE in Firefox in very specific condition

XMLWordPrintable

      So I have just spent a significant amount of time debugging this issue.

      Given I am using Firefox
      And I have just opened my browser (or am using a Private browsing tab)
      And I am using the TinyMCE editor
      And I open a modal form (I used the Dashboard calendar's "New event" button
      And I have that form generate a server-side error which causes the form to be reloaded - I set a value for the Name, and set the Event type to "Course" without selecting a course
      When I submit the form
      Then I should not see any NS_ERROR_UNEXPECTED errors in the JavaScript Console

      Unfortunately I haven't been able to replicate it outside of Moodle to be able to report this upstream, but I can reliably reproduce it in Moodle.

      Essentially what happens is that when we're creating an editor after having removed an editor with the same id from the DOM, and then removing it from the TinyMCE editor API, when using Firefox, the reference in the Editor API to the contentWindow does not match the iFrame contentWindow that it's meant to return.

      I have yet to find out why this happens, but I do have a patch which addresses it.

      I'm going to continue to try and replicate this upstream, though we will hopefully have some support from TinyMCE themselves in the future which will make this easier.

        1. behat-test-passed.png
          behat-test-passed.png
          54 kB
        2. console-error-without-patch.png
          console-error-without-patch.png
          182 kB
        3. MDL-77740.png
          MDL-77740.png
          197 kB
        4. no-console-error-with-patch.png
          no-console-error-with-patch.png
          195 kB

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            David Woloszyn David Woloszyn
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 41 minutes
                1d 1h 41m

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