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

Ajax calls with incorrect mime types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1, 2.3.4
    • Fix Version/s: 2.5
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:

      Description

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/13