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

Store defaulthomepage as relative url, not full url

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • Hide

      Start testing before upgrade!

      1. Install Paul's plugin from MDL-82066 testing instructions
      2. Navigate to Appearance > Navigation in site administration and set the "Start page" to one of the options added by this plugin
      3. Upgrade
      4. Login as any user and make sure you are redirected to this page you set
      5. Login as admin and change the home page to any other page
      6. Logout and login again and make sure you are redirected to the new page you set
      7. As admin set the "Start page" to "user preference"
      8. As any user (incl admin) go to your Preferences (in the menu under user picture in top right corner) and then "Start page"
      9. Set the start page to "Page 1"
      10. Logout and login and make sure you are redirected to Page 1
      Show
      Start testing before upgrade! Install Paul's plugin from MDL-82066 testing instructions Navigate to Appearance > Navigation in site administration and set the "Start page" to one of the options added by this plugin Upgrade Login as any user and make sure you are redirected to this page you set Login as admin and change the home page to any other page Logout and login again and make sure you are redirected to the new page you set As admin set the "Start page" to "user preference" As any user (incl admin) go to your Preferences (in the menu under user picture in top right corner) and then "Start page" Set the start page to "Page 1" Logout and login and make sure you are redirected to Page 1

      With the hook introduced in MDL-82066 plugins can extend the defaulthomepage menu, however the url is stored as a full url

      It is NOT checked to be a local url when it is set in the hook, but it is cleaned to the PARAM_LOCALURL when it is used.

      This will not work if the site was moved from one domain to another and also will not work in multi-domain environment that we introduce in Workplace in 4.5

      Instead I suggest the following:

      • in core_user\hook\extend_default_homepage in the add_option function check that submitted url is local url and store it as $this->options[$url->out_as_local_url()] = $title;
      • in get_home_page() expect that the value is already a relative url

            marina Marina Glancy
            marina Marina Glancy
            Paul Holden Paul Holden
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.