From: Greg Sabino Mullane Date: Thu, 21 Dec 2006 15:20:19 +0000 (+0000) Subject: Fix Watchlist with patch from Sven Klemm, bug 8350 X-Git-Tag: 1.31.0-rc.0~54826 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=9230fe6baa7a0d5d89e0133d1f332f25551dbb7f;p=lhc%2Fweb%2Fwiklou.git Fix Watchlist with patch from Sven Klemm, bug 8350 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b52c3f8ec0..50b04e1517 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -364,6 +364,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN it; pulling from slave meant the record was often not the updated one. * (bug 8335) Set image width to the first valid parameter found. +* (bug 8350) Fix watchlist viewing bug when using Postgres. == Languages updated == diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 6a917a41b3..3232bf61b6 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -150,10 +150,10 @@ function wfSpecialWatchlist( $par ) { wfAppendToArrayIfNotDefault('namespace', $nameSpace , $defaults, $nondefaults); if ( $days <= 0 ) { - $cutoff = false; + $andcutoff = ''; $npages = wfMsg( 'watchlistall1' ); } else { - $cutoff = $dbr->timestamp( time() - intval( $days * 86400 ) ); + $andcutoff = "AND rc_timestamp > '".$dbr->timestamp( time() - intval( $days * 86400 ) )."'"; /* $sql = "SELECT COUNT(*) AS n FROM $page, $revision WHERE rev_timestamp>'$cutoff' AND page_id=rev_page"; $res = $dbr->query( $sql, $fname ); @@ -295,8 +295,8 @@ function wfSpecialWatchlist( $par ) { WHERE wl_user=$uid AND wl_namespace=rc_namespace AND wl_title=rc_title - AND rc_timestamp > '$cutoff' AND rc_cur_id=page_id + $andcutoff $andLatest $andHideOwn $andHideBots