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

Add module for displaying moodleform in a modal window

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test 1 modal forms

      1. As admin go to Site administration>Courses>Course custom fields
      2. Create a category
      3. Add new fields, edit fields, make sure the form is displayed in the modal dialogue and works properly.

      Test 2 ajax (embedded) forms and repeat element

      1. Install a plugin from https://github.com/marinaglancy/moodle-local_modalformexamples
      2. Open page /local/modalformexamples/ , it has links to four different examples
      3. Make sure the repeated elements work in all four forms, both client- and server-side validation work, etc.

      Test 3 AJAX/modal forms

      1. As admin set $CFG->userquota to something low
      2. Login as a regular user (not admin)
      3. Go to your private files by clicking the "Private files" link in the side panel (it will take you to /user/files.php)
      4. Add some files to your private files area, save changes
      5. Make sure the page is not reloaded, only the filemanager is reloaded
      6. Upload file above the limit
      7. Save the changes and make sure an error is displayed in a form
      8. With unsaved changes try to navigate away (click on a "Dashboard" link, for example)
      9. Make sure a warning is displayed
      10. Save changes and navigate away
      11. Make sure there is no warning (unfortunately at the moment there can be an extra warning here, see below)
      12. Go to your dashboard and locate the "Private files" block
      13. Click on the "Manage private files..." link
      14. Make sure you can interact with a private files popup the same way you could on the Private files page

      General note: there may be some situations when the warning about unsaved changes appears when it should not appear. This should be fixed in MDL-69918

      Show
      Test 1 modal forms As admin go to Site administration>Courses>Course custom fields Create a category Add new fields, edit fields, make sure the form is displayed in the modal dialogue and works properly. Test 2 ajax (embedded) forms and repeat element Install a plugin from https://github.com/marinaglancy/moodle-local_modalformexamples Open page /local/modalformexamples/ , it has links to four different examples Make sure the repeated elements work in all four forms, both client- and server-side validation work, etc. Test 3 AJAX/modal forms As admin set $CFG->userquota to something low Login as a regular user (not admin) Go to your private files by clicking the "Private files" link in the side panel (it will take you to /user/files.php) Add some files to your private files area, save changes Make sure the page is not reloaded, only the filemanager is reloaded Upload file above the limit Save the changes and make sure an error is displayed in a form With unsaved changes try to navigate away (click on a "Dashboard" link, for example) Make sure a warning is displayed Save changes and navigate away Make sure there is no warning (unfortunately at the moment there can be an extra warning here, see below) Go to your dashboard and locate the "Private files" block Click on the "Manage private files..." link Make sure you can interact with a private files popup the same way you could on the Private files page General note: there may be some situations when the warning about unsaved changes appears when it should not appear. This should be fixed in MDL-69918
    • Affected Branches:
      MOODLE_311_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_311_STABLE
    • Pull 3.11 Branch:
      MDL-64554-311
    • Pull Master Branch:
      MDL-64554-master

      Description

      Currently it is very complicated to display a form inside a modal window. This tutorial is too difficult to follow and have some errors https://docs.moodle.org/dev/MForm_Modal

      Create a easy way to display a form in a popup

        Attachments

        1. test1.jpg
          256 kB
          Víctor Déniz Falcón
        2. test2.jpg
          210 kB
          Víctor Déniz Falcón
        3. test3.jpg
          101 kB
          Víctor Déniz Falcón

          Issue Links

            Activity

              People

              Assignee:
              marina Marina Glancy
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Integrator:
              Andrew Lyons Andrew Lyons
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 3 days, 1 hour, 36 minutes
                  1w 3d 1h 36m