Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/346555 )

Change subject: Display nice error when suppressed rev data is found
......................................................................

Display nice error when suppressed rev data is found

Depending on the outcome of the linked ticket we will
allow suppressed data here but do something special with
it / fill it with blank data.

Bug: T162255
Change-Id: I58648893a4f38e14fd708b5fa6031493b29a4bf4
---
M src/MediaWiki/ApiDetailRetriever.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileImporter 
refs/changes/55/346555/1

diff --git a/src/MediaWiki/ApiDetailRetriever.php 
b/src/MediaWiki/ApiDetailRetriever.php
index cae8750..01ea5e5 100644
--- a/src/MediaWiki/ApiDetailRetriever.php
+++ b/src/MediaWiki/ApiDetailRetriever.php
@@ -211,6 +211,11 @@
        private function getTextRevisionsFromRevisionsInfo( array 
$revisionsInfo, $pageTitle ) {
                $revisions = [];
                foreach ( $revisionsInfo as $revisionInfo ) {
+                       if ( array_key_exists( 'suppressed', $revisionInfo ) ) {
+                               // TODO allow importing revisions with 
suppressed content T162255
+                               throw new ImportException( 'Can not import 
revisions with suppressed content.' );
+                       }
+
                        $revisionInfo['minor'] = array_key_exists( 'minor', 
$revisionInfo );
                        $revisionInfo['title'] = $pageTitle;
                        $revisions[] = new TextRevision( $revisionInfo );

-- 
To view, visit https://gerrit.wikimedia.org/r/346555
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58648893a4f38e14fd708b5fa6031493b29a4bf4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FileImporter
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to