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. Especially check the following:
        • if there are changes in the form and you close the tab the browser displays the warning
        • after you submit, cancel or even simply close the dialogue (by pressing X) there is no "unsaved changes" warning if you try to close the tab
        • when you use atto as the editor, enter the text in the editor field, leave the window open until the "Draft saved" message appears and then refresh the tab. If you start editing a different element - the text is not restored, if you start editing the same element - text is restored. After you submit/cancel/close dialogue and edit the same element - the text is not restored.
        • text in the editor is saved if you use tinymce editor

      Test 2 ajax (embedded) forms and repeat element

      1. Pick the last commit from the branch https://github.com/moodle/moodle/compare/master...marinaglancy:MDL-64554-master-test 

        git fetch https://github.com/marinaglancy/moodle MDL-64554-master-test && git merge --no-ff FETCH_HEAD

      2. Open pages /tag/test1.php , /tag/test2.php , /tag/test3.php
      3. Make sure the repeated elements work in all three forms, browser alerts about closing the window if there are unsaved changes, editor text is saved, etc.
      4. For the ajax form in /tag/test3.php repeat the same tests that you were doing for course custom fields

      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
      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
      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
      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. Especially check the following: if there are changes in the form and you close the tab the browser displays the warning after you submit, cancel or even simply close the dialogue (by pressing X) there is no "unsaved changes" warning if you try to close the tab when you use atto as the editor, enter the text in the editor field, leave the window open until the "Draft saved" message appears and then refresh the tab. If you start editing a different element - the text is not restored, if you start editing the same element - text is restored. After you submit/cancel/close dialogue and edit the same element - the text is not restored. text in the editor is saved if you use tinymce editor Test 2 ajax (embedded) forms and repeat element Pick the last commit from the branch https://github.com/moodle/moodle/compare/master...marinaglancy:MDL-64554-master-test  git fetch https: //github.com/marinaglancy/moodle MDL-64554-master-test && git merge --no-ff FETCH_HEAD Open pages /tag/test1.php , /tag/test2.php , /tag/test3.php Make sure the repeated elements work in all three forms, browser alerts about closing the window if there are unsaved changes, editor text is saved, etc. For the ajax form in /tag/test3.php repeat the same tests that you were doing for course custom fields 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 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 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
    • Affected Branches:
      MOODLE_36_STABLE
    • 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

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour, 1 minute
                  1d 1h 1m