| Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
| — | — | @@ -917,15 +917,18 @@ |
| 918 | 918 | $key = wfMemcKey( 'flaggedrevs', 'unreviewedrevs', $article->getId() ); |
| 919 | 919 | if ( !$forUpdate ) { |
| 920 | 920 | $val = $wgMemc->get( $key ); |
| 921 | | - $count = is_integer( $val ) ? $val : null; |
| | 921 | + if( is_integer($val) ) $count = $val; |
| 922 | 922 | } |
| | 923 | + # Otherwise, fetch from DB as needed |
| 923 | 924 | if ( is_null( $count ) ) { |
| 924 | 925 | $db = $forUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
| 925 | 926 | $count = (int)$db->selectField( 'revision', 'COUNT(*)', |
| 926 | 927 | array( 'rev_page' => $article->getId(), "rev_id > " . intval( $revId ) ), |
| 927 | 928 | __METHOD__ ); |
| 928 | | - # Save to cache |
| 929 | | - $wgMemc->set( $key, $count, $wgParserCacheExpireTime ); |
| | 929 | + # Save to cache if there are such edits |
| | 930 | + if( $count ) { |
| | 931 | + $wgMemc->set( $key, $count, $wgParserCacheExpireTime ); |
| | 932 | + } |
| 930 | 933 | } |
| 931 | 934 | return $count; |
| 932 | 935 | } |
| Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
| — | — | @@ -483,9 +483,6 @@ |
| 484 | 484 | */ |
| 485 | 485 | public static function pendingEditNotice( $flaggedArticle, $frev, $revsSince ) { |
| 486 | 486 | global $wgLang; |
| 487 | | - if( $revsSince < 1 ) { |
| 488 | | - return ''; // only for pending edits |
| 489 | | - } |
| 490 | 487 | $flags = $frev->getTags(); |
| 491 | 488 | $time = $wgLang->date( $frev->getTimestamp(), true ); |
| 492 | 489 | # Add message text for pending edits |