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

Ajax calls with incorrect mime types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.5
    • 2.1.1, 2.3.4
    • JavaScript
    • MOODLE_21_STABLE, MOODLE_23_STABLE
    • MOODLE_25_STABLE
    • Hide

      Open the 'Network' tab of your browser

      • Navigate to Navigation -> My profile -> My private files
      • Click the 'Add' button to load the File picker
        • Confirm that the call to repository_ajax.php had a Type of 'application/json'
      • Close the file picker
      • Navigate to Administration -> Site administration -> Users -> Permissions -> Assign system roles
      • Select a role
      • Enter some content into the 'Search' box
        • Confirm that the call to /user/selector/search.php had a Type of 'application/json'
      • Edit /user/selector/search.php
        • Add a call to print_error('foo'); somewhere in the output
      • Enter some new content into the search box (no need to reload the page)
        • Confirm that the AjaxException dialogue was shown complete with your message and stack trace
      • throw a new moodle_exception (or similar)
      • Enter some new content into the search box (no need to reload the page)
        • Confirm that the Exception dialogue was shown complete with your message and stack trace
      Show
      Open the 'Network' tab of your browser Navigate to Navigation -> My profile -> My private files Click the 'Add' button to load the File picker Confirm that the call to repository_ajax.php had a Type of 'application/json' Close the file picker Navigate to Administration -> Site administration -> Users -> Permissions -> Assign system roles Select a role Enter some content into the 'Search' box Confirm that the call to /user/selector/search.php had a Type of 'application/json' Edit /user/selector/search.php Add a call to print_error('foo'); somewhere in the output Enter some new content into the search box (no need to reload the page) Confirm that the AjaxException dialogue was shown complete with your message and stack trace throw a new moodle_exception (or similar) Enter some new content into the search box (no need to reload the page) Confirm that the Exception dialogue was shown complete with your message and stack trace

      While trying to run our Moodle website behind a proxy with Apache mod_proxy (for internal reasons) we encountered issues due to some ajax json responses not being sent using correct myme-type.

      Note: Some modules like file manager (blocks/file_manager/ajax.php) explicitly set their ajax response myme type to application/json

            dobedobedoh Andrew Lyons
            kmach-poly Kassim Machioudi
            Tim Hunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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