Skip to content

Commit

Permalink
Bug #3, fix OUOP.fix_mod_assign_redirect($) Javascript [iet:8854131]
Browse files Browse the repository at this point in the history
  • Loading branch information
nfreear committed May 5, 2017
1 parent 55e1a7c commit f7e0bcc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 9 additions & 4 deletions user/ouop-local-fixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,18 @@

OUOP.fix_mod_assign_redirect = function ($) {
var $page = $('#page-mod-assign-redirect.ouop-fix-assign-redirect');
var errormsg = $page.find('.debuggingmessage').text();
var errormsg = $('.debuggingmessage').text();
var $link = $page.find('.continuebutton a');
var url = $link.attr('href');

if (errormsg && errormsg.match(/Error calling message processor email/)) {
C.warn('ouop: mod-assign-redirect-fix - trigger');
if ($page.length && errormsg && errormsg.match(/Error calling message processor email/)) {
W.setTimeout(function () {
C.warn('ouop: mod-assign-redirect-fix - trigger:', url);

W.location = url;

$link.trigger('click');
// Does not work ~ $link.trigger('click');
}, 200);
}
};

Expand Down
10 changes: 5 additions & 5 deletions user/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@

OUOP.handle_moodle_events($);

$body.addClass(data.body_class)
.addClass(data.profile.ouop_is_team ? 'ouop-is-team' : 'ouop-not-team');

$body.addClass(data.debug);

OUOP.consent_document_embed($, data);

OUOP.fix_pilot_survey_links($, data);
Expand All @@ -54,11 +59,6 @@
OUOP.complete_moodle_user_profile_form($, data);
OUOP.user_profile_form_redirect($, data);

$body.addClass(data.body_class)
.addClass(data.profile.ouop_is_team ? 'ouop-is-team' : 'ouop-not-team');

$body.addClass(data.debug);

// Was: if ( L.pathname.match(/^\/user\/edit/) )
if (!data.profile.ouop_is_team) {
disable_moodle_user_profile_form($);
Expand Down

0 comments on commit f7e0bcc

Please sign in to comment.