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

IE Compatibility View problem - Moodle 2.5 repository_ajax.php tries to download in browser

    Details

    • Testing Instructions:
      Hide

      (difficulty: easy, requires IE8, IE9, IE10 among the other supported browsers. For the nature of the patch backport, please test both 2.5 and 2.6|master branches)

      Note: You must test in all supported browsers including IE 8, 9, and 10.

      1. Upload a file resource using the most recent version of the supported browsers, IE8-9 and IE 10 in Compatibility View 1 included (being the ones affected by this issue): it must work as expected for each tested browser;
      2. Upload the same file resource again: a confirmation popup about overwriting the previous file will appear. For the developers (<F12> in your browser): the JSON response will be always returned as text/plain while the overwrite confirmation will be served as text/plain only for IE in Compatibility View, otherwise application/json.
      3. Confirm that no errors were shown and everything works as expected

      1 Configuring Compatibility View is quickly set by means of the IE Developer Tools, by pressing <F12>, then clicking on Browser Mode in the top menu and selecting the appropriate mode.

      Show
      (difficulty: easy, requires IE8, IE9, IE10 among the other supported browsers. For the nature of the patch backport, please test both 2.5 and 2.6|master branches) Note: You must test in all supported browsers including IE 8, 9, and 10. Upload a file resource using the most recent version of the supported browsers, IE8-9 and IE 10 in Compatibility View 1 included (being the ones affected by this issue): it must work as expected for each tested browser; Upload the same file resource again: a confirmation popup about overwriting the previous file will appear. For the developers ( <F12> in your browser): the JSON response will be always returned as text/plain while the overwrite confirmation will be served as text/plain only for IE in Compatibility View, otherwise application/json . Confirm that no errors were shown and everything works as expected 1 Configuring Compatibility View is quickly set by means of the IE Developer Tools , by pressing <F12> , then clicking on Browser Mode in the top menu and selecting the appropriate mode .
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      m26_MDL-39810_IE_Compatibility_View_Does_Not_Recognize_JSON_RFC4627_MIME_Type

      Description

      Users are encountering problems when they use IE and try to upload any file through the file resource.

      When they try and upload the file, they are asked if they wise to open or save "repository_ajax.php" file

      The fix is to add the "@header('Content-type: text/html; charset=utf-8');" code snippet after line 59 (echo $OUTPUT->header(); // send headers)

      So it should be:

      .....
      echo $OUTPUT->header(); // send headers

      // add this code snippet
      @header('Content-type: text/html; charset=utf-8');
      // end add

      .....

      This was missed in 2.5 and it was included in earlier 2.x versions

      https://moodle.org/mod/forum/discuss.php?d=228568

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  10 Vote for this issue
                  Watchers:
                  21 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Nov/13