107 $successCount, $pageInfo ) {
108 ( $this->mOriginalPageOutCallback )( $pageIdentity, $foreignTitle, $revisionCount, $successCount, $pageInfo );
110 if ( $pageIdentity ===
null ) {
111 # Invalid or non-importable title; a notice is already displayed
117 $linkRenderer = $services->getLinkRenderer();
118 if ( $successCount > 0 ) {
122 "<li>" . $linkRenderer->makeLink( $pageIdentity ) .
" " .
124 $this->msg(
'import-revision-count' )->numParams( $successCount )->escaped() .
129 $logParams = [
'4:number:count' => $successCount ];
130 if ( $this->mIsUpload ) {
131 $detail = $this->
msg(
'import-logentry-upload-detail' )->numParams(
132 $successCount )->inContentLanguage()->text();
135 $pageTitle = $foreignTitle->getFullText();
136 $fullInterwikiPrefix = (string)$this->mInterwiki;
137 $this->getHookRunner()->onImportLogInterwikiLink(
138 $fullInterwikiPrefix, $pageTitle );
140 $interwikiTitleStr = $fullInterwikiPrefix .
':' . $pageTitle;
141 $interwiki =
'[[:' . $interwikiTitleStr .
']]';
142 $detail = $this->
msg(
'import-logentry-interwiki-detail' )->numParams(
143 $successCount )->params( $interwiki )->inContentLanguage()->text();
144 $action =
'interwiki';
145 $logParams[
'5:title-link:interwiki'] = $interwikiTitleStr;
147 if ( $this->reason ) {
148 $detail .= $this->
msg(
'colon-separator' )->inContentLanguage()->text()
152 $wikiPage = $services->getWikiPageFactory()->newFromTitle( $pageIdentity );
153 $dummyRevRecord = $wikiPage->newPageUpdater( $this->
getUser() )
154 ->setCause( PageUpdater::CAUSE_IMPORT )
159 $logEntry->setTarget( $pageIdentity );
160 $logEntry->setComment( $this->reason );
161 $logEntry->setPerformer( $this->
getUser() );
162 $logEntry->setParameters( $logParams );
164 $logEntry->setAssociatedRevId( $dummyRevRecord->getId() );
165 if ( count( $this->logTags ) ) {
166 $logEntry->addTags( $this->logTags );
168 $logid = $logEntry->insert();
169 $logEntry->publish( $logid );
171 $this->
getOutput()->addHTML(
"<li>" . $linkRenderer->makeKnownLink( $pageIdentity ) .
" " .
172 $this->msg(
'import-nonewrevisions' )->escaped() .
"</li>\n" );
178 if ( $this->mLogItemCount > 0 ) {
179 $msg = $this->
msg(
'imported-log-entries' )->numParams( $this->mLogItemCount )->parse();
180 $out->addHTML( Html::rawElement(
'li', [], $msg ) );
181 } elseif ( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
182 $out->addHTML(
"</ul>\n" );
184 return Status::newFatal(
'importnopages' );
186 $out->addHTML(
"</ul>\n" );
188 return Status::newGood( $this->mPageCount );