From c8ff86e82b396823688107241fe08457e1a75f4c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 28 Jun 2007 15:05:03 +0000 Subject: [PATCH] * (bug 10397) Fix AJAX watch error fallback when we receive a bogus result --- RELEASE-NOTES | 1 + skins/common/ajaxwatch.js | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 95b5de4f05..4c793d0a3c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -223,6 +223,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN and the redirect deleted * (bug 7071) Properly handle an 'oldid' passed to view or edit that doesn't match the given title. Fixes inconsistencies with talk, history, edit links. +* (bug 10397) Fix AJAX watch error fallback when we receive a bogus result == API changes since 1.10 == diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js index 0389a049ce..08b947a5ea 100644 --- a/skins/common/ajaxwatch.js +++ b/skins/common/ajaxwatch.js @@ -73,10 +73,7 @@ wgAjaxWatch.processResult = function(request) { return; } var response = request.responseText; - if( response.match(/^/) ) { - window.location.href = wgAjaxWatch.watchLinks[0].href; - return; - } else if( response.match(/^/) ) { + if( response.match(/^/) ) { wgAjaxWatch.watching = true; wgAjaxWatch.setLinkText(wgAjaxWatch.unwatchMsg); wgAjaxWatch.setLinkID("ca-unwatch"); @@ -86,6 +83,10 @@ wgAjaxWatch.processResult = function(request) { wgAjaxWatch.setLinkText(wgAjaxWatch.watchMsg); wgAjaxWatch.setLinkID("ca-watch"); wgAjaxWatch.setHref( 'watch' ); + } else { + // Either we got a error code or it just plain broke. + window.location.href = wgAjaxWatch.watchLinks[0].href; + return; } jsMsg( response.substr(4), 'watch' ); wgAjaxWatch.inprogress = false; -- 2.20.1