I've only tested on Chrome and Firefox, and it seems to be just a Firefox issue as far as I can tell. In the browser's debug console, "TypeError: element is undefined" keeps showing up on course pages when I'm logged in, even when I just right-click on the page. Doesn't seem to show on admin settings pages.
Adding "if (element) { ... }" in url_rewriter.php seems to fix it:
document.addEventListener('click', function (event) {
var element = event.srcElement;
if (element) { // **Here**
while (element.tagName != 'A') {
if (!element.parentElement) {
return;
}
element = element.parentElement;
}
if (element.getAttribute('href').charAt(0) == '#') {
element.href = '{$clean}' + element.getAttribute('href');
}
} // **And closing bracket**
}, true);
</script>
I've only tested on Chrome and Firefox, and it seems to be just a Firefox issue as far as I can tell. In the browser's debug console, "TypeError: element is undefined" keeps showing up on course pages when I'm logged in, even when I just right-click on the page. Doesn't seem to show on admin settings pages.
Adding "if (element) { ... }" in url_rewriter.php seems to fix it: