Moodle
  1. Moodle
  2. MDL-36302

Return URL is incorrect on course editing page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.8, 2.2.5, 2.3.2
    • Fix Version/s: 2.2.7, 2.3.4
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as admin/teacher
      2. Navigate to a course
      3. Click Edit settings under Course admin
      4. Click Turn settings on/off from Course admin
      5. Verify the user is returned to the course settings page and edit mode is turned off/on.
      Show
      Log in as admin/teacher Navigate to a course Click Edit settings under Course admin Click Turn settings on/off from Course admin Verify the user is returned to the course settings page and edit mode is turned off/on.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36302-master
    • Rank:
      45093

      Description

      There are a number of actions that lead away from the course editing page after which the user is returned. This includes adding/deleting/moving blocks, changing languages and turning editing on/off. Currently there is a problem with these actions. When the system tries to return the user to the course settings page, an error is given.

      Replication steps:

      1. Log in as admin/teacher
      2. Navigate to a course
      3. Click Edit settings under Course admin
      4. Click Turn editing on/off from Course admin

      Expected result: The user is returned to the course settings page

      Actual result: An error is shown...

      Either course id or category must be specified
      
      More information about this error
      Debug info:
      Error code: needcoursecategroyid
      Stack trace:
      
          line 467 of \lib\setuplib.php: moodle_exception thrown
          line 62 of \course\edit.php: call to print_error()
      

      I think the return URL issue is a recent development after MDL-32184, however there was a problem prior to this that was caused by the page URL being incorrect.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Add returning to the settings page after a session timeout to the list.

          Show
          Michael de Raadt added a comment - Add returning to the settings page after a session timeout to the list.
          Hide
          Justin Filip added a comment -

          [Y] Syntax
          [-] Output
          [Y] Whitespace
          [-] Language
          [-] Databases
          [Y] Testing
          [-] Security
          [-] Documentation
          [N] Git
          [Y] Sanity check

          the commit message is missing the component – http://docs.moodle.org/dev/Peer_reviewing_checklist#Git

          Show
          Justin Filip added a comment - [Y] Syntax [-] Output [Y] Whitespace [-] Language [-] Databases [Y] Testing [-] Security [-] Documentation [N] Git [Y] Sanity check the commit message is missing the component – http://docs.moodle.org/dev/Peer_reviewing_checklist#Git
          Hide
          Damyon Wiese added a comment -

          Thanks Justin - I've changed the commit message and repushed the branches.

          Show
          Damyon Wiese added a comment - Thanks Justin - I've changed the commit message and repushed the branches.
          Hide
          Andrew Davis added a comment -

          In the testing instructions I think this

          Click Turn settings on/off from Course admin

          should be

          Click "Turn editing on/off" under Course admin
          Show
          Andrew Davis added a comment - In the testing instructions I think this Click Turn settings on/off from Course admin should be Click "Turn editing on/off" under Course admin
          Hide
          Andrew Davis added a comment - - edited

          Hi Justin. We're trying to get the QA related issues fixed asap. Thankyou for your help I am however switching this over to me as peer reviewer so we can get this over the line today as I'm not sure where in the world you are.

          update: Hi Justin. Actually, I know you! You will presumably be fast asleep right now.

          Show
          Andrew Davis added a comment - - edited Hi Justin. We're trying to get the QA related issues fixed asap. Thankyou for your help I am however switching this over to me as peer reviewer so we can get this over the line today as I'm not sure where in the world you are. update: Hi Justin. Actually, I know you! You will presumably be fast asleep right now.
          Hide
          Justin Filip added a comment -

          Actually, I'm not quite asleep yet.

          It's only just about 22:30 here. But fair enough. Review away.

          Show
          Justin Filip added a comment - Actually, I'm not quite asleep yet. It's only just about 22:30 here. But fair enough. Review away.
          Hide
          Damyon Wiese added a comment -

          Testing instructions updated.

          Show
          Damyon Wiese added a comment - Testing instructions updated.
          Hide
          Andrew Davis added a comment -

          Justin, you're still up at 22:30? You crazy kids!

          Damyon, you are go for integration.

          Show
          Andrew Davis added a comment - Justin, you're still up at 22:30? You crazy kids! Damyon, you are go for integration.
          Hide
          Damyon Wiese added a comment -

          Thanks Andrew and Justin!

          Show
          Damyon Wiese added a comment - Thanks Andrew and Justin!
          Hide
          Dan Poltawski added a comment -

          Hi Damyon,

          It looks to me that there is one small bit of tidyup which you haven't considered. The two lines within the following if, which are trying to do the same thing (but I am guessing they are not actually setting anything in the $PAGE->url, weird we don't throw debug notice for it:

          $PAGE->url->param('id',$id);
          
          $PAGE->url->param('category',$categoryid);
          

          It'd be good to remove them as I think they look confusing and are useless.

          Show
          Dan Poltawski added a comment - Hi Damyon, It looks to me that there is one small bit of tidyup which you haven't considered. The two lines within the following if, which are trying to do the same thing (but I am guessing they are not actually setting anything in the $PAGE->url, weird we don't throw debug notice for it: $PAGE->url->param('id',$id); $PAGE->url->param('category',$categoryid); It'd be good to remove them as I think they look confusing and are useless.
          Hide
          Damyon Wiese added a comment -

          Thanks Dan - I didn't spot that. I have repushed the branches with this change.

          Show
          Damyon Wiese added a comment - Thanks Dan - I didn't spot that. I have repushed the branches with this change.
          Hide
          Dan Poltawski added a comment -

          Thanks Damyon. I've integrated this now.

          Show
          Dan Poltawski added a comment - Thanks Damyon. I've integrated this now.
          Hide
          Rajesh Taneja added a comment -

          Thanks Damyon,

          Works Great. Clicking Turn editing on/off returns to course editing page.

          Show
          Rajesh Taneja added a comment - Thanks Damyon, Works Great. Clicking Turn editing on/off returns to course editing page.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Y E S !

          Closing as fixed, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Y E S ! Closing as fixed, many thanks!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: