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

"Too many params passed to js_call_amd" notice should say what it means

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.5.4
    • 3.4, 3.5.3
    • Libraries
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_35_STABLE
    • Hide

      Ensure that Debugging is set to Developer level.

      Hack some code so that it calls js_call_amd with lots of arguments. (You can do this be installing qtype_coderunner, then creating a question with an 'Answer box preload' longer than 1 Kb, then previewing that question.

      Verify that the debug message is accurate.

      Show
      Ensure that Debugging is set to Developer level. Hack some code so that it calls js_call_amd with lots of arguments. (You can do this be installing qtype_coderunner, then creating a question with an 'Answer box preload' longer than 1 Kb, then previewing that question. Verify that the debug message is accurate.

      As a developer (of the CodeRunner question type) I am finding the following code in lib/outputrequirementslib.php a bit troublesome:

      {{ if ($CFG->debugdeveloper) {}}
          $toomanyparamslimit = 1024;
          if (strlen($strparams) > $toomanyparamslimit) {
              debugging('Too many params passed to js_call_amd("' . $fullmodule . '", "' . $func . '")',       DEBUG_DEVELOPER);
      {{    }}}
      {{ }}}

      Is there a good reason for this check?  The error message itself is confusing as it's not the number of parameters that's the issue, but the lengths of the JSON-encoded parameter list. I am passing an array of selected language strings to my AMD modules and often triggering this error. Since it only affects developers, it's not a major problem and I've simply commented it out but I would like to know if there is a potential problem with passing an array of strings to AMD modules.

       

            timhunt Tim Hunt
            trampgeek Richard Lobb
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            David Monllaó David Monllaó
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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