Moodle
  1. Moodle
  2. MDL-22528

AJAX Course editing does not work in Chrome

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8, 2.0
    • Fix Version/s: 1.9, 2.0
    • Component/s: AJAX and JavaScript, Course
    • Labels:
      None
    • Environment:
      Ubuntu 10.04; Google Chrome & Chromium browsers (both latest versions)
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      27382

      Description

      Switching on the AJAX course editing works fine in Firefox, but does nothing in Google Chrome / Chromium Browser.

        Activity

        Hide
        Davo Smith added a comment -

        Oddly, if I bypass the PHP browser-detection code, then it all seems to work fully (aside from a couple of image bugs, that also seem to affect firefox, which I will post separately).

        Show
        Davo Smith added a comment - Oddly, if I bypass the PHP browser-detection code, then it all seems to work fully (aside from a couple of image bugs, that also seem to affect firefox, which I will post separately).
        Hide
        Davo Smith added a comment -

        Changing the browser list in course/format/topics/ajax.php and course/format/weeks/ajax.php seems to enable the latest versions of Safari, Chrome and Chromium to edit courses without any obvious issues (although only tested on a small test course).

        The just needs changing from:

        $CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111);

        to:

        $CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531);

        (I'm sure a much smaller version number would also work fine, but I only have access to the latest versions of Chrome/Chromium & Safari, so I can't test any others).

        Show
        Davo Smith added a comment - Changing the browser list in course/format/topics/ajax.php and course/format/weeks/ajax.php seems to enable the latest versions of Safari, Chrome and Chromium to edit courses without any obvious issues (although only tested on a small test course). The just needs changing from: $CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111); to: $CFG->ajaxtestedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531); (I'm sure a much smaller version number would also work fine, but I only have access to the latest versions of Chrome/Chromium & Safari, so I can't test any others).
        Hide
        Jay Pfaffman added a comment -

        Thanks, Davo!

        This is an easy fix and Chrome is going to get more popular. I'd love for this to get into regular releases Real Soon Now.

        Show
        Jay Pfaffman added a comment - Thanks, Davo! This is an easy fix and Chrome is going to get more popular. I'd love for this to get into regular releases Real Soon Now.
        Hide
        Dominik Lukes added a comment -

        I tried this fix on Windows (XAMPP) with Preview 4 but it didn't seem to fix the issue. Works fine in Firefox.

        I'm running Chrome 6 DEV 6.0.437.3

        Show
        Dominik Lukes added a comment - I tried this fix on Windows (XAMPP) with Preview 4 but it didn't seem to fix the issue. Works fine in Firefox. I'm running Chrome 6 DEV 6.0.437.3
        Hide
        Davo Smith added a comment -

        Dominik - could try visiting the site: http://www.useragentstring.com/ and letting me know what version of 'safari' is reported on there?

        I am currently getting 534.2, with Chromium daily build + Ubuntu Linux; anything above 531 should allow AJAX to work, after the above changes to the 2 files (and assuming AJAX is enabled, AJAX course editing is enabled and the logged-in user has AJAX enabled).

        Show
        Davo Smith added a comment - Dominik - could try visiting the site: http://www.useragentstring.com/ and letting me know what version of 'safari' is reported on there? I am currently getting 534.2, with Chromium daily build + Ubuntu Linux; anything above 531 should allow AJAX to work, after the above changes to the 2 files (and assuming AJAX is enabled, AJAX course editing is enabled and the logged-in user has AJAX enabled).
        Hide
        Dongsheng Cai added a comment -

        Thanks guys.

        I attached a patch here, not sure if we should sperate chrome from safari.

        Show
        Dongsheng Cai added a comment - Thanks guys. I attached a patch here, not sure if we should sperate chrome from safari.
        Hide
        Dongsheng Cai added a comment -

        I don't know who is maintaining ajax course editing, but saw Rossiani fixed plenty bugs of course edting, so I added her to review the patch

        Show
        Dongsheng Cai added a comment - I don't know who is maintaining ajax course editing, but saw Rossiani fixed plenty bugs of course edting, so I added her to review the patch
        Hide
        Ryan Smith added a comment -

        Looks like these changes were checked into MOODLE19_STABLE today. I tested with the latest version of Chrome and AJAX works great. Now if someone would just patch the HTML Editor, we could officially support Chrome and Safari. Right now the editor just defaults to text only entry on those browsers.

        Show
        Ryan Smith added a comment - Looks like these changes were checked into MOODLE19_STABLE today. I tested with the latest version of Chrome and AJAX works great. Now if someone would just patch the HTML Editor, we could officially support Chrome and Safari. Right now the editor just defaults to text only entry on those browsers.
        Hide
        Rossiani Wijaya added a comment -

        Dongsheng,

        I tested the patch on both browsers (Chrome and Safari) and it works. The patch also works in older version of Chrome.
        Patch has been committed to 1.9_stable and 2.0.

        Thanks everyone.

        Show
        Rossiani Wijaya added a comment - Dongsheng, I tested the patch on both browsers (Chrome and Safari) and it works. The patch also works in older version of Chrome. Patch has been committed to 1.9_stable and 2.0. Thanks everyone.
        Hide
        Rossiani Wijaya added a comment -

        Thanks Ryan for testing the issue.

        Regarding with the issue of HTML Editor support for Chrome and Safari, please take a look MDL-24626 and MDL-16336.

        Show
        Rossiani Wijaya added a comment - Thanks Ryan for testing the issue. Regarding with the issue of HTML Editor support for Chrome and Safari, please take a look MDL-24626 and MDL-16336 .
        Hide
        Ryan Smith added a comment -

        Thanks for linking to that issue, Rossiani. The only problem is that bug has been open since September 2008 and there seems to be no priority to add the fix to the 1.9.x branch. Very frustrating for our Chrome and Safari users!

        Show
        Ryan Smith added a comment - Thanks for linking to that issue, Rossiani. The only problem is that bug has been open since September 2008 and there seems to be no priority to add the fix to the 1.9.x branch. Very frustrating for our Chrome and Safari users!
        Hide
        Rossiani Wijaya added a comment -

        Resolving issue.

        Show
        Rossiani Wijaya added a comment - Resolving issue.

          People

          • Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: