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

JSON parsing error management: unbalance behaviours

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: Filepicker, JavaScript
    • Labels:
    • Affected Branches:
      MOODLE_23_STABLE

      Description

      It could be really useful to let the user always see the error behind the invalid JSON reply, especially if related to the server configuration (see e.g. PHP file size limit) and not to a Moodle issue:

      • commented out:

        moodle-master/lib/form/filemanager.js:
        ...
                                } catch(e) {
                                    // TODO display error
                                    scope.print_msg(M.str.repository.invalidjson, 'error');
                                    //scope.display_error(M.str.repository.invalidjson+'<pre>'+stripHTML(o.responseText)+'</pre>', 'invalidjson')
                                    return;
                                }
        ...

      • managed:

        moodle-master/repository/filepicker.js:
        ...
                                } catch(e) {
                                    scope.print_msg(M.str.repository.invalidjson, 'error');
                                    scope.display_error(M.str.repository.invalidjson+'<pre>'+stripHTML(o.responseText)+'</pre>', 'invalidjson')
                                    return;
                                }
        ...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              matteo Matteo Scaramuccia
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: