/**
* Get rev_timestamp from rev_id, without loading the rest of the row
+ * @param Title $title
* @param integer $id
- * @param integer $pageid, optional
*/
- static function getTimestampFromId( $id, $pageId = 0 ) {
+ static function getTimestampFromId( $title, $id ) {
$dbr = wfGetDB( DB_SLAVE );
$conds = array( 'rev_id' => $id );
- if( $pageId ) {
- $conds['rev_page'] = $pageId;
- }
+ $conds['rev_page'] = $title->getArticleId();
$timestamp = $dbr->selectField( 'revision', 'rev_timestamp', $conds, __METHOD__ );
if ( $timestamp === false && wfGetLB()->getServerCount() > 1 ) {
# Not in slave, try master
function lastModified() {
global $wgLang, $wgArticle;
if( $this->mRevisionId ) {
- $timestamp = Revision::getTimestampFromId( $this->mRevisionId, $wgArticle->getId() );
+ $timestamp = Revision::getTimestampFromId( $wgArticle->getTitle(), $this->mRevisionId );
} else {
$timestamp = $wgArticle->getTimestamp();
}
$this->sendMails();
- $latestTimestamp = Revision::getTimestampFromId( $title->getLatestRevID() );
+ $latestTimestamp = Revision::getTimestampFromId( $title, $title->getLatestRevID() );
// Do not update watchlists if something else already did.
if ( $timestamp >= $latestTimestamp && ($wgShowUpdatedMarker || $wgEnotifWatchlist) ) {
# Mark the changed watch-listed page with a timestamp, so that the page is