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

Atto Editor outputs 'undefined' when user enters text before plugins have fully loaded



    • Affected Branches:


      When atto is loading on a page, a user is able to enter text before the editor is able to fully load all plugins. As a result the user is effectively entering html code and not the expected 'text' most users might expect.

      To reproduce:
      1. Clear cache.
      2. Access page with an Atto editor enabled.
      3. (Be fast!) Before all plugins have loaded in Atto editor window, click the editors input area and enter text.
      4. Save changes.
      5. The text resolves to 'undefined' when displayed.

      In the example above be sure to act quickly, alternatively use an internet connection throttler to mimic slower internet connection speeds (environments where this is most common).

      From our investigations the editor loads the ".editor_atto > textarea" element prior to loading the ".editor_atto > div.editor_atto_content" element. This is the same textarea that is loaded when the user clicks the Html plugin button. Hence any text entered in this textarea is interpreted as html.

      Our suggestion would be to make the textarea uneditable until all plugins have loaded? Or perhaps the textarea or editor_atto_content elements should only display once all plugins have loaded?


      We are running Moodle 2.7 (Build: 20140512)




            • Votes:
              4 Vote for this issue
              8 Start watching this issue


              • Created: