For Moodle sites with multiple domains/aliases, "mod_url" onclick events cache the absolute URL.
In cases where a site has multiple domains i.e. for different customers or campuses, but the same moodle installation. This is an issue.
It means that when a user visits "a.moodle.site" any cached links displayed on "b.moodle.site" will link to "a.moodle.site". This looks inconsistent and forces the user to login again.
Steps to reproduce:
- Create a standard moodle installation.
- Setup the installation on both a.moodle.site and b.moodle.site(as an alias)
- Open a course on "a.moodle.site" and observe that the "onclick" events are all for "a.moodle.site"
- Open the same course on "b.moodle.site", observe that "onclick" events contain "a.moodle.site"
I have created a fix for this here: https://github.com/LoneBeta/moodle/commit/9fb1e689092d7e3202d0e29e255f526a6ea70eed.patch