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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.5.3
    • Fix Version/s: 3.5.4
    • Component/s: Libraries
    • Labels:

      Description

      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.

       

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jan/19

                  Time Tracking

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