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

JS Error when toggling section visibility

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.2
    • Component/s: JavaScript
    • Labels:
      None
    • Testing Instructions:
      Hide
      1. Open up a course in a drag and drop upload supporting browser (Chrome, Firefox)
      2. Turn editing on
      3. Make sure javascript error console is displayed in your browser (Developer tools in Chrome, Firebug in Firefox)
      4. Make sure that drag and drop upload is enabled (the yellow notification box should appear at the top of the course page)
      5. Hide a section

      Expected result: no javascript errors (apart from, possibly, a 'Refusing to set unsafe header 'user-agent'', or similar)

      Show
      Open up a course in a drag and drop upload supporting browser (Chrome, Firefox) Turn editing on Make sure javascript error console is displayed in your browser (Developer tools in Chrome, Firebug in Firefox) Make sure that drag and drop upload is enabled (the yellow notification box should appear at the top of the course page) Hide a section Expected result: no javascript errors (apart from, possibly, a 'Refusing to set unsafe header 'user-agent'', or similar)
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-34214_dndupload_preview_element

      Description

      The JS section visibility toggle also hides all visible activities/resources in that section. It does so by selecting all li.activity and looping through them toggling them if required. It also disables the show/hide button.

      Just noticed that when toggling a section, errors are currently shown. This appears to be caused by dndupload creating a new li for the dndupload-preview which also has the activity class on it.

      There are several potential solutions to this issue:

      • remove the activity class from dndupload-preview;
      • make the toggle handle li.activity with a missing toolbox better
      • both of the above

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12