* @return array
*/
public static function getSelectQueryData() {
- $tables = [ 'logging', 'user' ];
+ $commentQuery = CommentStore::newKey( 'log_comment' )->getJoin();
+
+ $tables = [ 'logging', 'user' ] + $commentQuery['tables'];
$fields = [
'log_id', 'log_type', 'log_action', 'log_timestamp',
'log_user', 'log_user_text',
'log_namespace', 'log_title', // unused log_page
- 'log_comment', 'log_params', 'log_deleted',
+ 'log_params', 'log_deleted',
'user_id', 'user_name', 'user_editcount',
- ];
+ ] + $commentQuery['fields'];
$joins = [
// IPs don't have an entry in user table
'user' => [ 'LEFT JOIN', 'log_user=user_id' ],
- ];
+ ] + $commentQuery['joins'];
return [
'tables' => $tables,
}
public function getComment() {
- return $this->row->log_comment;
+ return CommentStore::newKey( 'log_comment' )->getComment( $this->row )->text;
}
public function getDeleted() {
}
public function getComment() {
- return $this->row->rc_comment;
+ return CommentStore::newKey( 'rc_comment' )
+ // Legacy because the row probably used RecentChange::selectFields()
+ ->getCommentLegacy( wfGetDB( DB_REPLICA ), $this->row )->text;
}
public function getDeleted() {
'log_namespace' => $this->getTarget()->getNamespace(),
'log_title' => $this->getTarget()->getDBkey(),
'log_page' => $this->getTarget()->getArticleID(),
- 'log_comment' => $comment,
'log_params' => LogEntryBase::makeParamBlob( $params ),
];
if ( isset( $this->deleted ) ) {
$data['log_deleted'] = $this->deleted;
}
+ $data += CommentStore::newKey( 'log_comment' )->insert( $dbw, $comment );
$dbw->insert( 'logging', $data, __METHOD__ );
$this->id = $dbw->insertId();