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

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

    Details

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

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              dobedobedoh 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
              dobedobedoh 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
              poltawski Dan Poltawski added a comment -

              Hi Andrew,

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

              Dan

              Show
              poltawski Dan Poltawski added a comment - Hi Andrew, I can't reproduce this issue. Can you give any steps to reproduce it? Dan
              Hide
              dobedobedoh 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
              dobedobedoh 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
              poltawski Dan Poltawski added a comment -

              I tested on Chrome and firefox and couldn't reproduce

              Show
              poltawski Dan Poltawski added a comment - I tested on Chrome and firefox and couldn't reproduce
              Hide
              dobedobedoh 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
              dobedobedoh 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
              dobedobedoh Andrew Nicols added a comment -
              Show
              dobedobedoh Andrew Nicols added a comment - Discussed in the forums at http://moodle.org/mod/forum/discuss.php?d=165142
              Hide
              dobedobedoh 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
              dobedobedoh 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 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 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
              dobedobedoh 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
              dobedobedoh 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
              poltawski 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
              poltawski 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
              tsala 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
              tsala 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:
                    Fix Release Date:
                    21/Feb/11