Index: trunk/extensions/PageTriage/PageTriage.hooks.php |
— | — | @@ -107,13 +107,25 @@ |
108 | 108 | * Add page to page triage queue |
109 | 109 | */ |
110 | 110 | private static function addToPageTriageQueue( $pageId ) { |
| 111 | + $dbr = wfGetDB( DB_SLAVE ); |
111 | 112 | $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 | + |
113 | 125 | $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 | + ); |
118 | 130 | |
119 | 131 | $dbw->replace( 'pagetriage_page', array( 'ptrp_page_id' ), $row, __METHOD__ ); |
120 | 132 | } |