protected function form() {
$out = $this->getOutput();
- $out->addModules( 'mediawiki.userSuggest' );
// Consume values
$this->opts->consumeValue( 'offset' ); // don't carry offset, DWIW
'default' => $tagFilterVal,
],
'username' => [
- 'type' => 'text',
+ 'type' => 'user',
'name' => 'username',
'label-message' => 'newpages-username',
'default' => $userText,
'id' => 'mw-np-username',
'size' => 30,
- 'cssclass' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
],
'size' => [
'type' => 'sizefilter',
$htmlForm = new HTMLForm( $form, $this->getContext() );
$htmlForm->setSubmitText( $this->msg( 'newpages-submit' )->text() );
- $htmlForm->setSubmitProgressive();
// The form should be visible on each request (inclusive requests with submitted forms), so
// return always false here.
$htmlForm->setSubmitCallback(
/**
* @param stdClass $result Result row from recent changes
- * @return Revision|bool
+ * @param Title $title
+ * @return bool|Revision
*/
- protected function revisionFromRcResult( stdClass $result ) {
+ protected function revisionFromRcResult( stdClass $result, Title $title ) {
return new Revision( [
- 'comment' => CommentStore::newKey( 'rc_comment' )->getComment( $result )->text,
+ 'comment' => CommentStore::getStore()->getComment( 'rc_comment', $result )->text,
'deleted' => $result->rc_deleted,
'user_text' => $result->rc_user_text,
'user' => $result->rc_user,
- ] );
+ 'actor' => $result->rc_actor,
+ ], 0, $title );
}
/**
// Revision deletion works on revisions,
// so cast our recent change row to a revision row.
- $rev = $this->revisionFromRcResult( $result );
- $rev->setTitle( $title );
+ $rev = $this->revisionFromRcResult( $result, $title );
$classes = [];
$attribs = [ 'data-mw-revid' => $result->rev_id ];