mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 11:56:40 +02:00
MDL-62889 message_popup: only add redirecturl if it exists
We allow notifications to have a null value for the 'contexturl'. In this case we should not be appending a 'redirecturl' param to the URL when it is going to be empty.
This commit is contained in:
parent
b80a22f5ba
commit
38d309036c
2 changed files with 8 additions and 5 deletions
File diff suppressed because one or more lines are too long
|
@ -223,10 +223,13 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str', 'core/url',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Link to mark read page before loading the actual link.
|
// Link to mark read page before loading the actual link.
|
||||||
notification.contexturl = URL.relativeUrl('message/output/popup/mark_notification_read.php', {
|
var notificationurlparams = {
|
||||||
notificationid: notification.id,
|
notificationid: notification.id
|
||||||
redirecturl: notification.contexturl
|
};
|
||||||
});
|
if (notification.contexturl) {
|
||||||
|
notificationurlparams.redirecturl = notification.contexturl;
|
||||||
|
}
|
||||||
|
notification.contexturl = URL.relativeUrl('message/output/popup/mark_notification_read.php', notificationurlparams);
|
||||||
|
|
||||||
var promise = Templates.render('message_popup/notification_content_item', notification)
|
var promise = Templates.render('message_popup/notification_content_item', notification)
|
||||||
.then(function(html, js) {
|
.then(function(html, js) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue