Andrew-WMDE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403179 )

Change subject: Handle file revisions that contain a missing image file
......................................................................

Handle file revisions that contain a missing image file

Merge only when https://gerrit.wikimedia.org/r/#/c/403174/ is merged.

Bug: T179645
Change-Id: Ia354f24315b89279a010dee494ca82ee9049e7d5
---
M i18n/en.json
M i18n/qqq.json
M src/Remote/MediaWiki/ApiDetailRetriever.php
3 files changed, 8 insertions(+), 2 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index a33bf1b..0be8a92 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -48,5 +48,6 @@
        "fileimporter-heading-filehistory": "File history",
        "fileimporter-revision-removed-text": "Suppressed text removed by 
FileImporter.",
        "fileimporter-revision-removed-comment": "Suppressed comment removed by 
FileImporter.",
-       "fileimporter-in-beta": "File import is in beta mode: We tested it 
carefully but it still might have some problems. If you encounter problems, 
please [//www.mediawiki.org/w/index.php?title=Extension_talk:FileImporter 
report them on our help page] - ideally with a step by step way to reproduce 
the problem, so we can understand and fix it."
+       "fileimporter-in-beta": "File import is in beta mode: We tested it 
carefully but it still might have some problems. If you encounter problems, 
please [//www.mediawiki.org/w/index.php?title=Extension_talk:FileImporter 
report them on our help page] - ideally with a step by step way to reproduce 
the problem, so we can understand and fix it.",
+       "fileimporter-filemissinginrevision": "Can't import file because at 
least one of its revisions is missing an image file."
 }
\ No newline at end of file
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a53a0f3..b52fae0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -51,5 +51,6 @@
        "fileimporter-heading-filehistory": "Heading of the file history on the 
import page.",
        "fileimporter-revision-removed-text": "Text inserted if the original 
text is suppressed.",
        "fileimporter-revision-removed-comment": "Text inserted as a revision 
comment if the original comment is suppressed.",
-       "fileimporter-in-beta": "Text shown when the special page is loaded 
warning the user that the extension is in beta."
+       "fileimporter-in-beta": "Text shown when the special page is loaded 
warning the user that the extension is in beta.",
+       "fileimporter-filemissinginrevision": "Error message shown when the 
file contains at least one revision with a missing image file."
 }
diff --git a/src/Remote/MediaWiki/ApiDetailRetriever.php 
b/src/Remote/MediaWiki/ApiDetailRetriever.php
index 9ed5ebf..1aedfec 100644
--- a/src/Remote/MediaWiki/ApiDetailRetriever.php
+++ b/src/Remote/MediaWiki/ApiDetailRetriever.php
@@ -256,6 +256,10 @@
                                throw new LocalizedImportException( 
'fileimporter-cantimportfilehidden' );
                        }
 
+                       if ( array_key_exists( 'filemissing', $revisionInfo ) ) 
{
+                               throw new LocalizedImportException( 
'fileimporter-filemissinginrevision' );
+                       }
+
                        if ( array_key_exists( 'userhidden', $revisionInfo ) ) {
                                $revisionInfo['user'] = 
$wgFileImporterAccountForSuppressedUsername;
                        }

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

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

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

Reply via email to