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

JSON parsing error management: unbalance behaviours

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Critical
    • None
    • 2.3
    • Filepicker, JavaScript
    • 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

              poltawski Dan Poltawski
              matteo Matteo Scaramuccia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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