* (bug 10397) Fix AJAX watch error fallback when we receive a bogus result
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 28 Jun 2007 15:05:03 +0000 (15:05 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 28 Jun 2007 15:05:03 +0000 (15:05 +0000)
RELEASE-NOTES
skins/common/ajaxwatch.js

index 95b5de4..4c793d0 100644 (file)
@@ -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 ==
index 0389a04..08b947a 100644 (file)
@@ -73,10 +73,7 @@ wgAjaxWatch.processResult = function(request) {
                return;
        }
        var response = request.responseText;
-       if( response.match(/^<err#>/) ) {
-               window.location.href = wgAjaxWatch.watchLinks[0].href;
-               return;
-       } else if( response.match(/^<w#>/) ) {
+       if( response.match(/^<w#>/) ) {
                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 <err#> error code or it just plain broke.
+               window.location.href = wgAjaxWatch.watchLinks[0].href;
+               return;
        }
        jsMsg( response.substr(4), 'watch' );
        wgAjaxWatch.inprogress = false;