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

The course edit page needs a way to redirect to some page other than the main course page after saving

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.6, 1.9.7, 1.9.8, 1.9.9, 2.6.3, 2.7, 2.9
    • 2.9
    • Course
    • MOODLE_19_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • 21724-29
    • Hide
      1. Run behat, it covers this area pretty thoroughly.

      This change is pretty simple, when editing a course there are now three options instead of two:

      • Previously there was "Save changes" and "Cancel"
      • Now there is "Save and return", "Save and display", and "Cancel"

      "Save and return" is only shown if the page that directed the user to edit the course specified a return path.
      The only place in Moodle that uses this new option presently is the course and category management interface.

      1. Log in as an admin
      2. Browse to a course
      3. Click "Edit settings" in the navigation block
      4. Check you see "Save and display" + "Cancel" only
      5. Change the description and check it takes you back to view the course.
      6. Browse to the Site Admin > Courses > Manage courses and categories
      7. Select a category and then click to edit a course (the cog icon)
      8. Change the description
      9. Check you see "Save and return" + "Save and display" + "Cancel" only
      10. Click save and return
      11. Check you get taken back to the course category management interface
      12. Click to edit the course again
      13. Change the description
      14. Click save and display
      15. Check you get taken to the course.

      Also:

      1. Log in as an admin
      2. Add a new course and press "Save and display"
      3. Ensure you're redirected to the course enrolments page.
      Show
      Run behat, it covers this area pretty thoroughly. This change is pretty simple, when editing a course there are now three options instead of two: Previously there was "Save changes" and "Cancel" Now there is "Save and return", "Save and display", and "Cancel" "Save and return" is only shown if the page that directed the user to edit the course specified a return path. The only place in Moodle that uses this new option presently is the course and category management interface. Log in as an admin Browse to a course Click "Edit settings" in the navigation block Check you see "Save and display" + "Cancel" only Change the description and check it takes you back to view the course. Browse to the Site Admin > Courses > Manage courses and categories Select a category and then click to edit a course (the cog icon) Change the description Check you see "Save and return" + "Save and display" + "Cancel" only Click save and return Check you get taken back to the course category management interface Click to edit the course again Change the description Click save and display Check you get taken to the course. Also: Log in as an admin Add a new course and press "Save and display" Ensure you're redirected to the course enrolments page.

    Description

      I've added code to course/edit.php and course/edit_form.php to allow someone to add a returnurl paramater when calling the course edit page that will then redirect after saving. For example, if you called /course/edit.php?id=1&returnurl=/index.php; after the form is saved, you'll be directed to /index.php.

      I've created a patch from my version 1.9.6 install that will make the changes, but I'm new to creating patches for this, so let me know if the file isn't in the right format.

      I based this on a discussion with Tim Hunt in the forums (http://moodle.org/mod/forum/discuss.php?d=126516#p630665)

      Attachments

        Activity

          People

            samhemelryk Sam Hemelryk
            inceebee Nate Baxley
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/May/15