Moodle
  1. Moodle
  2. MDL-25675

Move Right action causes JS Error: Uncaught TypeError: Cannot call method 'toString' of undefined

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Component/s: AJAX and JavaScript
    • Labels:
      None
    • Environment:
      Chrome 7.0.517.44-r64615
      Debian Lenny
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      15285

      Description

      The 'Move Right' icon appears to do nothing. The JS console reports:
      Uncaught TypeError: Cannot call method 'toString' of undefined

      Chrome inspector gives the following detail:
      Uncaught TypeError: Cannot call method 'toString' of undefined
      resource_class.indent_left/moodle/lib/javascript.php?file=%2Flib%2Fajax%2Fsection_classes.js&rev=160:50
      _addListener.N/moodle/theme/yui_combo.php?2.8.2/build/yahoo-dom-event/yahoo-dom-event.js&2.8.2/build/dragdrop/dragdrop-min.js&2.8.2/build/connection/connection-min.js&2.8.2/build/selector/selector-min.js:10

        Issue Links

          Activity

          Hide
          Andrew Nicols added a comment -

          lib/ajax/section_classes.js was using classList.toString() which doesn't seem to be defined anywhere in YUI or moodle. Converted to className and works as expected

          Show
          Andrew Nicols added a comment - lib/ajax/section_classes.js was using classList.toString() which doesn't seem to be defined anywhere in YUI or moodle. Converted to className and works as expected
          Hide
          Dan Poltawski added a comment -

          Hi Andrew,

          I can't reproduce this issue. Can you give any steps to reproduce it?

          Dan

          Show
          Dan Poltawski added a comment - Hi Andrew, I can't reproduce this issue. Can you give any steps to reproduce it? Dan
          Hide
          Andrew Nicols added a comment -

          It may be a chrome-only bug then. I replicated isn't latest version of chrome under debian. Think that Paul replicated using firefox on lenny too though.

          Errors pop up in the chrome inspector's console when clicking on the move right button on any course resource when editing is turned on. The resource doesn't move either.

          Show
          Andrew Nicols added a comment - It may be a chrome-only bug then. I replicated isn't latest version of chrome under debian. Think that Paul replicated using firefox on lenny too though. Errors pop up in the chrome inspector's console when clicking on the move right button on any course resource when editing is turned on. The resource doesn't move either.
          Hide
          Dan Poltawski added a comment -

          I tested on Chrome and firefox and couldn't reproduce

          Show
          Dan Poltawski added a comment - I tested on Chrome and firefox and couldn't reproduce
          Hide
          Andrew Nicols added a comment -

          I've just tested again on both Chrome and Firefox on MacOS and can't reproduce the issue.

          But I can reproduce this on Safari on MacOS. When I originally produced this, I was using Chrome on Debian and I think that Paul was using Firefox under Debian.

          I've also just tried on a Linux box and confirmed that this seems to affect Chrome under Debian.

          Have taken the opportunity to test my patch on all of the above and it seems to work.
          It seems that this is the only time that .classList is used in Moodle.

          Show
          Andrew Nicols added a comment - I've just tested again on both Chrome and Firefox on MacOS and can't reproduce the issue. But I can reproduce this on Safari on MacOS. When I originally produced this, I was using Chrome on Debian and I think that Paul was using Firefox under Debian. I've also just tried on a Linux box and confirmed that this seems to affect Chrome under Debian. Have taken the opportunity to test my patch on all of the above and it seems to work. It seems that this is the only time that .classList is used in Moodle.
          Hide
          Andrew Nicols added a comment -
          Show
          Andrew Nicols added a comment - Discussed in the forums at http://moodle.org/mod/forum/discuss.php?d=165142
          Hide
          Andrew Nicols added a comment -

          I hit this with the following version of chrome (retrieved from about

          Google Chrome 7.0.517.44 (Official Build 64615)
          WebKit 534.7
          V8 2.3.11.22
          User Agent Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
          Command Line /usr/bin/google-chrome --proxy-server=http://wwwcache0.lancs.ac.uk:8080 --enable-extension-timeline-api

          Show
          Andrew Nicols added a comment - I hit this with the following version of chrome (retrieved from about Google Chrome 7.0.517.44 (Official Build 64615) WebKit 534.7 V8 2.3.11.22 User Agent Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7 Command Line /usr/bin/google-chrome --proxy-server= http://wwwcache0.lancs.ac.uk:8080 --enable-extension-timeline-api
          Hide
          Stacey Walker added a comment -

          I have tried in both Firefox version 3.6.13 and Chrome version 8.0.552.224 on Ubuntu and it worked fine.

          Show
          Stacey Walker added a comment - I have tried in both Firefox version 3.6.13 and Chrome version 8.0.552.224 on Ubuntu and it worked fine.
          Hide
          Andrew Nicols added a comment -

          Also hit it with IceWeasel version 3.0.6
          Build identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.19) Gecko/2010120923 Iceweasel/3.0.6 (Debian-3.0.6-3)
          Again running Debian Lenny.

          Show
          Andrew Nicols added a comment - Also hit it with IceWeasel version 3.0.6 Build identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.19) Gecko/2010120923 Iceweasel/3.0.6 (Debian-3.0.6-3) Again running Debian Lenny.
          Hide
          Dan Poltawski added a comment -

          I've created PULL-78 as I tested, reproduced and verified this problem on Mac OSX.

          Although the error is not about toString() (which I believe is a standard JS function) but instead about classList being undefined:
          TypeError: Result of expression 'indentdiv.classList' [undefined] is not an object.

          Show
          Dan Poltawski added a comment - I've created PULL-78 as I tested, reproduced and verified this problem on Mac OSX. Although the error is not about toString() (which I believe is a standard JS function) but instead about classList being undefined: TypeError: Result of expression 'indentdiv.classList' [undefined] is not an object.
          Hide
          Helen Foster added a comment -

          Andrew, thanks for your report and Dan, thanks for your fix. All working perfectly now using Safari on a Mac.

          Show
          Helen Foster added a comment - Andrew, thanks for your report and Dan, thanks for your fix. All working perfectly now using Safari on a Mac.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: