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

Activity chooser: "sr" parameter set to null

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Additional behat test.

      Prerequisites:

      1. Create a course with a teacher enrolled.

      Testing

      1. As a teacher, go to the created course
      2. Make sure the url is set as 'course/view.php?id=[course_id]'
      3. Enable editing and click on 'Add activity or resource' under 'Topic 2'
      4. Add an assignment activity and click 'Save and return to course'
      5. Confirm you are taken to the course page and are jumped to Topic 2.
      6. *Confirm the url has '#section=2' appended
      7. Go to Edit settings for course
      8. Under Course format, set Course layout to "Show one section per page"
      9. Click Save and Display
      10. Go to (or create) section like Topic 5
      11. Add an activity and click "Save and return to course"
      12. Confirm: Go to page showing just the section 'Topic 5': https://qa.moodledemo.net/course/view.php?id= {course_id}&section=5
      Show
      Additional behat test. Prerequisites: Create a course with a teacher enrolled. Testing As a teacher, go to the created course Make sure the url is set as 'course/view.php?id= [course_id] ' Enable editing and click on 'Add activity or resource' under 'Topic 2' Add an assignment activity and click 'Save and return to course' Confirm you are taken to the course page and are jumped to Topic 2. *Confirm the url has '#section=2' appended Go to Edit settings for course Under Course format, set Course layout to "Show one section per page" Click Save and Display Go to (or create) section like Topic 5 Add an activity and click "Save and return to course" Confirm: Go to page showing just the section 'Topic 5': https://qa.moodledemo.net/course/view.php?id= {course_id}&section=5
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-69065-master
    • Sprint:
      3.9 release work board, 4.0 holding pattern

      Description

      I am using the Moodle 3.9 master (2020061500.00) and noticed that our custom format is broken when adding a course module via the new Activity chooser.

      The problem is that on current STABLE moodle versions the "sr" parameter is being set, but on master the "sr" parameter is no longer being set and just left null.

      Example:

      Moodle 3.5 URL when adding content: https://ccle.ucla.edu/course/modedit.php?add=assign&type=&course=212&section=3&return=0&sr=3

      Moodle master URL when adding content: https://qa.moodledemo.net/course/modedit.php?add=assign&type=&course=2&section=1&return=0&sr=

      Some formats use "sr", such as ours, use that parameter when overriding the get_view_url() method when we inherit format_base.

      Is the "sr" parameter being deprecated? If so, we can adjust our code to account for it, but it seems like a bug that the new activity chooser is just not setting it properly.

      The JS code that appears to be missing setting the sr parameter is: https://github.com/moodle/moodle/blob/master/course/amd/src/activitychooser.js#L144

      It is just setting "module.link += '&section=' + id;"

      With no sr parameter.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              peterdias Peter Dias
              Reporter:
              rex Rex Lorenzo
              Peer reviewer:
              Mihail Geshoski
              Integrator:
              Jake Dallimore
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Jul/20

                  Time Tracking

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