From feb6a5203541a95980e0524e9294c9dbee6e7b99 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 18 Jul 2018 17:52:34 +0800 Subject: [PATCH] MDL-54551 core: touch-up after review 1. Reworded the string. 2. Removed logic handling form data. 3. Do not use window.location.replace. --- lang/en/webservice.php | 2 +- lib/amd/build/ajax.min.js | Bin 1584 -> 1449 bytes lib/amd/src/ajax.js | 10 ++-------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lang/en/webservice.php b/lang/en/webservice.php index 20af1fe4612..1aac8701e72 100644 --- a/lang/en/webservice.php +++ b/lang/en/webservice.php @@ -186,7 +186,7 @@ $string['service'] = 'Service'; $string['servicehelpexplanation'] = 'A service is a set of functions. A service can be accessed by all users or just specified users.'; $string['servicename'] = 'Service name'; $string['servicenotavailable'] = 'Web service is not available (it doesn\'t exist or might be disabled)'; -$string['servicerequireslogin'] = 'Web service requires login (the session has been logged out or has expired. Please save any work on the current page before continuing)'; +$string['servicerequireslogin'] = 'Web service is not available (the session has been logged out or has expired)'; $string['servicesbuiltin'] = 'Built-in services'; $string['servicescustom'] = 'Custom services'; $string['serviceusers'] = 'Authorised users'; diff --git a/lib/amd/build/ajax.min.js b/lib/amd/build/ajax.min.js index 8a6dfe491930bd588bf21f27af49b487535867c5..a585b990bfb1a9789b2ef5f4fc7e2511c6a54e76 100644 GIT binary patch delta 423 zcmZ{g%SyvQ6oyHo2wrx&EHnkn3>}8LuoUCy6S#C$f=nmpOj1LJ=3<2sT)DT*Be>F) z;A8j{zKKcWLIpQx^PkK2owxm$y{A#X%#wbVSNWhSF&GUDrV;0dIF20c}yg*#`fWoDEra5b|UM!LkH}YJK2o} z0}=^uL^oFN&+eyF=a1WWr${-(eGM04rh_gNH(8wjKbQZ@r7VqjBP2b*E%nb15_AT)?maO>pf zZd@&B9n#9!|6`;I{IuFnQs-~_x#u1buCsCm)Pdo?e2SLGS80~mD{8FZ6_B8u8!jM# z8I5oZCWq#~*?VL_6Oe%rB%yH#!Xp*>0=%C?IT?_oUJT!WyKyyA1!`(}AHI>QfOPst zn!$^`$?2$y_60PuyS)Ga diff --git a/lib/amd/src/ajax.js b/lib/amd/src/ajax.js index 3130fdc85eb..088deca4aa4 100644 --- a/lib/amd/src/ajax.js +++ b/lib/amd/src/ajax.js @@ -25,7 +25,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 2.9 */ -define(['jquery', 'core/config', 'core/log', 'core/yui', 'core/url'], function($, config, Log, Y, URL) { +define(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Log, URL) { // Keeps track of when the user leaves the page so we know not to show an error. var unloading = false; @@ -81,13 +81,7 @@ define(['jquery', 'core/config', 'core/log', 'core/yui', 'core/url'], function($ if (exception !== null) { // If the user isn't doing anything too important, redirect to the login page. if (exception.errorcode === "servicerequireslogin") { - Y.use('moodle-core-formchangechecker', function() { - if (!M.core_formchangechecker.get_form_dirty_state()) { - // If we reach here, the user isn't editing anything on the page. - var loginUrl = URL.relativeUrl("/login/index.php"); - window.location.replace(loginUrl); - } - }); + window.location = URL.relativeUrl("/login/index.php"); } else { for (; i < requests.length; i++) { request = requests[i]; -- 2.43.0