<?php
/**
- *
- *
- * Created on Feb 13, 2009
- *
* Copyright © 2009 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
$prop = array_flip( $params['prop'] );
$this->addFieldsIf( 'pt_user', isset( $prop['user'] ) || isset( $prop['userid'] ) );
- $this->addFieldsIf( 'pt_reason', isset( $prop['comment'] ) || isset( $prop['parsedcomment'] ) );
$this->addFieldsIf( 'pt_expiry', isset( $prop['expiry'] ) );
$this->addFieldsIf( 'pt_create_perm', isset( $prop['level'] ) );
+ if ( isset( $prop['comment'] ) || isset( $prop['parsedcomment'] ) ) {
+ $commentStore = CommentStore::getStore();
+ $commentQuery = $commentStore->getJoin( 'pt_reason' );
+ $this->addTables( $commentQuery['tables'] );
+ $this->addFields( $commentQuery['fields'] );
+ $this->addJoinConds( $commentQuery['joins'] );
+ }
+
$this->addTimestampWhereRange( 'pt_timestamp', $params['dir'], $params['start'], $params['end'] );
$this->addWhereFld( 'pt_namespace', $params['namespace'] );
$this->addWhereFld( 'pt_create_perm', $params['level'] );
}
if ( isset( $prop['comment'] ) ) {
- $vals['comment'] = $row->pt_reason;
+ $vals['comment'] = $commentStore->getComment( 'pt_reason', $row )->text;
}
if ( isset( $prop['parsedcomment'] ) ) {
- $vals['parsedcomment'] = Linker::formatComment( $row->pt_reason, $title );
+ $vals['parsedcomment'] = Linker::formatComment(
+ $commentStore->getComment( 'pt_reason', $row )->text, $titles
+ );
}
if ( isset( $prop['expiry'] ) ) {
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Protectedtitles';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Protectedtitles';
}
}