* @deprecated since 1.32, use getDerivedDataUpdater instead.
*
* @param Content $content
- * @param Revision|RevisionRecord|int|null $revision Revision object.
- * For backwards compatibility, a revision ID is also accepted,
- * but this is deprecated.
+ * @param Revision|RevisionRecord|null $revision Revision object.
* Used with vary-revision or vary-revision-id.
* @param User|null $user
* @param string|null $serialFormat IGNORED
$user = $wgUser;
}
- if ( !is_object( $revision ) ) {
- $revid = $revision;
- // This code path is deprecated, and nothing is known to
- // use it, so performance here shouldn't be a worry.
- if ( $revid !== null ) {
- wfDeprecated( __METHOD__ . ' with $revision = revision ID', '1.25' );
- $store = $this->getRevisionStore();
- $revision = $store->getRevisionById( $revid, Revision::READ_LATEST );
- } else {
- $revision = null;
+ if ( $revision !== null ) {
+ if ( $revision instanceof Revision ) {
+ $revision = $revision->getRevisionRecord();
+ } elseif ( !( $revision instanceof RevisionRecord ) ) {
+ throw new InvalidArgumentException(
+ __METHOD__ . ': invalid $revision argument type ' . gettype( $revision ) );
}
- } elseif ( $revision instanceof Revision ) {
- $revision = $revision->getRevisionRecord();
}
$slots = RevisionSlotsUpdate::newFromContent( [ SlotRecord::MAIN => $content ] );
$dbw->endAtomic( __METHOD__ );
$jobParams = [
+ 'namespace' => $this->getTitle()->getNamespace(),
+ 'title' => $this->getTitle()->getDBkey(),
'wikiPageId' => $id,
'requestId' => $webRequestId ?? WebRequest::getRequestId(),
'reason' => $reason,
'logsubtype' => $logsubtype,
];
- $job = new DeletePageJob( $this->getTitle(), $jobParams );
+ $job = new DeletePageJob( $jobParams );
JobQueueGroup::singleton()->push( $job );
$status->warning( 'delete-scheduled',
return [ [ 'alreadyrolled',
htmlspecialchars( $this->mTitle->getPrefixedText() ),
htmlspecialchars( $fromP ),
- htmlspecialchars( $targetEditorForPublic ? $targetEditorForPublic->getName() : '' )
+ htmlspecialchars( $currentEditorForPublic ? $currentEditorForPublic->getName() : '' )
] ];
}
*/
public function updateCategoryCounts( array $added, array $deleted, $id = 0 ) {
$id = $id ?: $this->getId();
- $type = MWNamespace::getCategoryLinkType( $this->getTitle()->getNamespace() );
+ $type = MediaWikiServices::getInstance()->getNamespaceInfo()->
+ getCategoryLinkType( $this->getTitle()->getNamespace() );
$addFields = [ 'cat_pages = cat_pages + 1' ];
$removeFields = [ 'cat_pages = cat_pages - 1' ];