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

Skip redirect to Dashboard from logo link when $CFG->defaulthomepage is set

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • mdl-72838-fix-master
    • Hide

      Setup

      1. Login as admin.
      2. Go to "Site administration > Appearance > Logos".
      3. Upload an image to the "Compact logo" field and Save changes.

      Testing scenario 1. Logged out

      1.  Be logged out.
      2. On any page, confirm logo placed in the left up corner always links to site root ('/').

      Testing scenario 2. Logged in

      1. Log in as admin
      2. Go to Site Administration > Appearance > Navigation
      3. Set 'Home page for users' to 'Site'.
      4. Confirm logo links to site root ('/')
      5. Set 'Home page for users' to 'Dashboard'.
      6. Confirm logo links to user dashboard root ('/my/')
      7. Set 'Home page for users' to 'My courses'.
      8. Confirm logo links to user courses root ('/my/courses.php')
      9. Set 'Home page for users' to User preference.
      10. Go to user menu > Preferences > Home page
      11. Set 'Home page' to 'Site'
      12. Confirm logo links to site root ('/')
      13. Set 'Home page' to 'Dashboard'
      14. Confirm logo links to user dashboard root ('/my/')
      15. Set 'Home page' to 'My courses'
      16. Confirm logo links to user courses root ('my/courses.php')
      Show
      Setup Login as admin. Go to "Site administration > Appearance > Logos". Upload an image to the "Compact logo" field and Save changes. Testing scenario 1. Logged out  Be logged out. On any page, confirm logo placed in the left up corner always links to site root ('/'). Testing scenario 2. Logged in Log in as admin Go to Site Administration > Appearance > Navigation Set 'Home page for users' to 'Site'. Confirm logo links to site root ('/') Set 'Home page for users' to 'Dashboard'. Confirm logo links to user dashboard root ('/my/') Set 'Home page for users' to 'My courses'. Confirm logo links to user courses root ('/my/courses.php') Set 'Home page for users' to User preference. Go to user menu > Preferences > Home page Set 'Home page' to 'Site' Confirm logo links to site root ('/') Set 'Home page' to 'Dashboard' Confirm logo links to user dashboard root ('/my/') Set 'Home page' to 'My courses' Confirm logo links to user courses root ('my/courses.php')

    Description

      In most sites $CFG->defaulthomepage is set to Dashboard and roughly 1% of traffic is people on random pages clicking on the logo of the site, which takes you to / which then redirects you to the dashboard here:

      https://github.com/moodle/moodle/blob/master/index.php#L72-L73

      So roughly 1% of traffic could be dropped, as well as at least a 100ms (or ~500ms on mobile) perceived page load speed up can be gained for these users by making the logo link to the correct place to start with and avoid the redirect.

      Attachments

        Activity

          People

            jasondendulk Jason den Dulk
            brendanheywood Brendan Heywood
            Brendan Heywood Brendan Heywood
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Gladys Basiana Gladys Basiana
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              19/Apr/22

              Time Tracking

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