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

Editor element passes too many parameters to the javascript

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 3.0.2
    • Fix Version/s: None
    • Component/s: Forms Library, JavaScript
    • Labels:
      None
    • Affected Branches:
      MOODLE_30_STABLE

      Description

      I discovered this while developing a custom text editor plugin that has javascript implemented via AMD modules - https://moodle.org/plugins/editor_marklar

      Any time the editor is used, the following debugging message is displayed:

      Too many params passed to js_call_amd("editor_marklar/editor", "init")
       
          line 1017 of /lib/outputrequirementslib.php: call to debugging()
          line 91 of /lib/editor/marklar/lib.php: call to page_requirements_manager->js_call_amd()
          line 388 of /lib/form/editor.php: call to marklar_texteditor->use_editor()
          ...
      

      However, this is not a problem in the editor or something that editor has under control. It is actually the existing Moodle core code that produces that huge file picker options and passes it to the editor. See $fpoptions at https://github.com/moodle/moodle/blob/master/lib/form/editor.php#L391

      The editor is supposed to have these options available in the javascript. When trying to do it, I get the mentioned warning: https://github.com/mudrd8mz/moodle-editor_marklar/blob/master/lib.php#L88

      So the problem here is that the form element "editor" generates too big file picker options.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: