Moodle
  1. Moodle
  2. MDL-30222

'Site home' link redirecting to /my when default home is My Moodle

    Details

    • Testing Instructions:
      Hide
      1. Log in as Admin go to Home ▶ Site administration ▶ Appearance ▶ Navigation
      2. Set "Default Home page for users" to 'My Moodle'
      3. Click the 'My home' link
      4. Check you are presented with http://example/my
      5. Click the 'Site home' link
      6. Check you are presented with http://example/
      7. Log in as Teacher or Student
      8. Click the 'My home' link
      9. Check you are presented with http://example/my
      10. Click the 'Site home' link
      11. Check you are presented with http://example/
      Show
      Log in as Admin go to Home ▶ Site administration ▶ Appearance ▶ Navigation Set "Default Home page for users" to 'My Moodle' Click the 'My home' link Check you are presented with http://example/my Click the 'Site home' link Check you are presented with http://example/ Log in as Teacher or Student Click the 'My home' link Check you are presented with http://example/my Click the 'Site home' link Check you are presented with http://example/
    • Workaround:
      Hide

      Change the Default Home page for users to User preference so users can choose.

      Show
      Change the Default Home page for users to User preference so users can choose.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-MDL-30222-m23
    • Rank:
      26488

      Description

      It is impossible for students or teachers to visit the 'Site home' page when Default Home page for users is 'My Moodle'.

      Users are directed to My home as expected with this being the preference in the Navigation block and Navigation bar. When users click the 'My home' link (URL: http://example/?redirect=0) it returns to http://example/my' rather than 'http://example/'

      When the Default Home page for users is set to 'Site' or 'User preference' the two links work as expected.
      I've got debugging on to display full developer messages and no error is presented. I cannot test this in demo.moodle.net as it is currently on version Moodle 2.1.1+ (Build: 20110817)

      Replication steps:

      1. Log in as Admin go to Home ▶ Site administration ▶ Appearance ▶ Navigation
      2. Set "Default Home page for users" to 'My Moodle'
      3. Click the 'My home' link - result: you are presented with your http://example/my page as expected
      4. Click the 'Site home' link - result: http://example/ page as expected
      1. Log in as Teacher or Student
      2. Click the 'My home' link - result: you are presented with your http://example/my page as expected
      1. Click the 'Site home' link
        Error: you are returned to http://example/my
        Expected result: you should be returned to http://example/

        Issue Links

          Activity

          Hide
          Buddy Ethridge added a comment -

          This is actually the way that we prefer it to work, but it should be an administratively configurable setting.

          Show
          Buddy Ethridge added a comment - This is actually the way that we prefer it to work, but it should be an administratively configurable setting.
          Hide
          Michael de Raadt added a comment -

          I was able to replicate the problem. It seems to be a problem that is happening in 2.2Dev, but not 2.1.1, as you say. Therefore it must be a regression caused by a recent change.

          I couldn't find any recent related issues that have been resolved, but perhaps Sam might have more of an insight there.

          Show
          Michael de Raadt added a comment - I was able to replicate the problem. It seems to be a problem that is happening in 2.2Dev, but not 2.1.1, as you say. Therefore it must be a regression caused by a recent change. I couldn't find any recent related issues that have been resolved, but perhaps Sam might have more of an insight there.
          Hide
          Michael de Raadt added a comment -

          Raising the priority on this issue as it has now been duplicated.

          Show
          Michael de Raadt added a comment - Raising the priority on this issue as it has now been duplicated.
          Hide
          Julien Boulen added a comment -

          Hi,

          We have this problem too on our moodle 2.x. We use this fix.

          I hope it will help.

          Show
          Julien Boulen added a comment - Hi, We have this problem too on our moodle 2.x. We use this fix. I hope it will help.
          Hide
          Sam Hemelryk added a comment -

          Thanks Julien for providing the solution, I've reviewed it now, turned it into git branches, and have put this up for peer-review.

          Providing that passes this will be put up for integration.
          Please note that it won't be included in the 2.2 release, however will be included immediately after.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks Julien for providing the solution, I've reviewed it now, turned it into git branches, and have put this up for peer-review. Providing that passes this will be put up for integration. Please note that it won't be included in the 2.2 release, however will be included immediately after. Cheers Sam
          Hide
          Aparup Banerjee added a comment -

          this look fine to me.

          Show
          Aparup Banerjee added a comment - this look fine to me.
          Hide
          Sam Hemelryk added a comment -

          Thanks Apu, up for integration now and included in sprint as requested by MdR

          Show
          Sam Hemelryk added a comment - Thanks Apu, up for integration now and included in sprint as requested by MdR
          Hide
          Sam Hemelryk added a comment -

          This has been rebased and branched after the release of 2.2 now.

          Pull 2.2 Branch: wip-MDL-30222-m22
          Pull 2.2 Diff URL: https://github.com/samhemelryk/moodle/compare/master...wip-MDL-30222-m22

          Show
          Sam Hemelryk added a comment - This has been rebased and branched after the release of 2.2 now. Pull 2.2 Branch: wip- MDL-30222 -m22 Pull 2.2 Diff URL: https://github.com/samhemelryk/moodle/compare/master...wip-MDL-30222-m22
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Ankit Agarwal added a comment -

          working great!

          Show
          Ankit Agarwal added a comment - working great!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Yes, you did it!

          Now your code is part of the best weeklies released ever, many thanks!

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Yes, you did it! Now your code is part of the best weeklies released ever, many thanks! Closing, ciao

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: