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

Read-only forms section collapsing broken

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-78728-401
    • MDL-78728-402
    • Hide

      Regression test only (read-only forms are covered by Behat)

      1. Login as admin
      2. Create a course
      3. Turn editing on
      4. Open Add an activity or resource modal
      5. Select File
      6. Manually expand each form section (General, Appearance, Common module settings, etc.) separately
      7. After the last section is expanded confirm the Expand all link has changed to Collapse all
      8. Manually collapse each form section separately
      9. After the last section is collapsed confirm the Collapse all link has changed to Expand all
      10. Press Expand all
      11. Confirm all sections are expanded
      12. Press Collapse all
      13. Confirm all sections are collapsed
      14. Manually expand the Restrict access section
      15. Confirm the Access restrictions text is shown, along with None and Add restriction.. button
      Show
      Regression test only (read-only forms are covered by Behat) Login as admin Create a course Turn editing on Open Add an activity or resource modal Select File Manually expand each form section (General, Appearance, Common module settings, etc.) separately After the last section is expanded confirm the Expand all link has changed to Collapse all Manually collapse each form section separately After the last section is collapsed confirm the Collapse all link has changed to Expand all Press Expand all Confirm all sections are expanded Press Collapse all Confirm all sections are collapsed Manually expand the Restrict access section Confirm the Access restrictions text is shown, along with None and Add restriction.. button

      Discovered while looking at MDL-78707 - when toggling the sections in the test fixture, you receive the following errors on browser console

      09:19:12.820 Uncaught TypeError: formParent is null
          init http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:1870
          jQuery 7
          show http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          i jQuery
          handle http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4591
          jQuery 7
          triggerTransitionEnd http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4591
          transitionEndEmulator http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4591
          setTimeout handler*transitionEndEmulator http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4591
          show http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          toggle http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          Collapse http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          _jQueryInterface http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          jQuery 2
          _jQueryInterface http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          <anonymous> http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          jQuery 2
          <anonymous> http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4583
          jQuery 8
          <anonymous> http://moodle.internal/master/lib/requirejs.php/1689581882/core_form/events.js:4589
          execCb http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          check http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          bind http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          each http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          bind http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          each http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          init http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          h http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          completeLoad http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          onScriptLoad http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          load http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          load http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          load http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          fetch http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          check http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
          enable http://moodle.internal/master/lib/javascript.php/1689581882/lib/requirejs/require.min.js:5
      events.js:1870:2195
      

      To recreate manually navigate to <WWWROOT>/lib/tests/fixtures/readonlyform.php

      Pressing Expand all generates the same error and doesn't have any effect on the page (nothing is expanded). Looks to be a regression from MDL-75784, which assumes all the containers have a <form> ancestor

      This will be partly resolved by MDL-78707, there's just the expand/collapse all to fix here

      P.S. Make sure that the Behat scenario is updated along with this issue, despite the errors reported here it currently still passes (it shouldn't). The updated scenario should fail on current master, but pass when this issue is fixed

            pholden Paul Holden
            pholden Paul Holden
            Mohamed Shehata Mohamed Shehata
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.