r77738 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77737‎ | r77738 | r77739 >
Date:19:32, 4 December 2010
Author:aaron
Status:ok
Tags:
Comment:
* Show "pending edit" notice only on watchlists (not RC)
* Avoid using fp_reviewed (to be removed later, better for import edge case)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1841,31 +1841,27 @@
18421842 if ( !$wgUser->isAllowed( 'review' ) ) {
18431843 return true; // not relevant to user
18441844 }
1845 - $title = $out->getTitle();
18461845 $namespaces = FlaggedRevs::getReviewNamespaces();
1847 - if ( $title->getNamespace() == NS_SPECIAL && $namespaces ) {
1848 - $watchlist = SpecialPage::getTitleFor( 'Watchlist' );
1849 - $recentchanges = SpecialPage::getTitleFor( 'Recentchanges' );
1850 - # Notice applies only to RC/watchlists
1851 - if ( $title->equals( $watchlist ) || $title->equals( $recentchanges ) ) {
1852 - $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); // consistency with watchlist
1853 - $watchedOutdated = $dbr->selectField(
1854 - array( 'watchlist', 'page', 'flaggedpages' ),
1855 - '1', // existence
1856 - array( 'wl_user' => $wgUser->getId(), // this user
1857 - 'wl_namespace' => $namespaces, // reviewable
1858 - 'wl_namespace = page_namespace',
1859 - 'wl_title = page_title',
1860 - 'fp_page_id = page_id',
1861 - 'fp_reviewed' => 0, // edits pending
1862 - ), __METHOD__
1863 - );
1864 - # Give a notice if pages on the users's wachlist have pending edits
1865 - if ( $watchedOutdated ) {
1866 - $css = 'plainlinks fr-watchlist-pending-notice';
1867 - $out->prependHTML( "<div id='mw-fr-watchlist-pending-notice' class='$css'>" .
1868 - wfMsgExt( 'flaggedrevs-watched-pending', 'parseinline' ) . "</div>" );
1869 - }
 1846+ $watchlist = SpecialPage::getTitleFor( 'Watchlist' );
 1847+ # Add notice to watchlist about pending changes...
 1848+ if ( $out->getTitle()->equals( $watchlist ) && $namespaces ) {
 1849+ $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); // consistency with watchlist
 1850+ $watchedOutdated = (bool)$dbr->selectField(
 1851+ array( 'watchlist', 'page', 'flaggedpages' ),
 1852+ '1', // existence
 1853+ array( 'wl_user' => $wgUser->getId(), // this user
 1854+ 'wl_namespace' => $namespaces, // reviewable
 1855+ 'wl_namespace = page_namespace',
 1856+ 'wl_title = page_title',
 1857+ 'fp_page_id = page_id',
 1858+ 'fp_pending_since IS NOT NULL', // edits pending
 1859+ ), __METHOD__
 1860+ );
 1861+ # Give a notice if pages on the users's wachlist have pending edits
 1862+ if ( $watchedOutdated ) {
 1863+ $css = 'plainlinks fr-watchlist-pending-notice';
 1864+ $out->prependHTML( "<div id='mw-fr-watchlist-pending-notice' class='$css'>" .
 1865+ wfMsgExt( 'flaggedrevs-watched-pending', 'parseinline' ) . "</div>" );
18701866 }
18711867 }
18721868 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r77740MFT r77275,r77738aaron19:51, 4 December 2010

Status & tagging log