r114718 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114717‎ | r114718 | r114719 >
Date:22:22, 4 April 2012
Author:kaldari
Status:deferred
Tags:
Comment:
we just want to record the timestamp for when the article was created for now
Modified paths:
  • /trunk/extensions/PageTriage/PageTriage.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageTriage/PageTriage.hooks.php
@@ -107,13 +107,25 @@
108108 * Add page to page triage queue
109109 */
110110 private static function addToPageTriageQueue( $pageId ) {
 111+ $dbr = wfGetDB( DB_SLAVE );
111112 $dbw = wfGetDB( DB_MASTER );
112 -
 113+
 114+ // Pull page creation date from database
 115+ $res = $dbr->select(
 116+ 'revision',
 117+ 'MIN(rev_timestamp) AS creation_date',
 118+ array( 'rev_page' => $pageId ),
 119+ __METHOD__
 120+ );
 121+ foreach ( $res as $row ) {
 122+ $creationDate = $row->creation_date;
 123+ }
 124+
113125 $row = array(
114 - 'ptrp_page_id' => $pageId,
115 - 'ptrp_triaged' => 0,
116 - 'ptrp_timestamp' => $dbw->timestamp( wfTimestampNow() )
117 - );
 126+ 'ptrp_page_id' => $pageId,
 127+ 'ptrp_triaged' => 0,
 128+ 'ptrp_timestamp' => $creationDate
 129+ );
118130
119131 $dbw->replace( 'pagetriage_page', array( 'ptrp_page_id' ), $row, __METHOD__ );
120132 }

Status & tagging log