jenkins-bot has submitted this change and it was merged. ( )

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

Handle file revisions that contain a missing image file

Merge only when is merged
and deployed.

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

  WMDE-Fisch: Looks good to me, approved
  jenkins-bot: Verified

diff --git a/i18n/en.json b/i18n/en.json
index 2ad222e..484209a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -49,5 +49,6 @@
        "fileimporter-revision-removed-text": "Suppressed text removed by 
        "fileimporter-revision-removed-comment": "Suppressed comment removed by 
        "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 [// 
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.",
        "fileimporter-filetoolarge": "The file you are currently trying to 
import exceeds the maximum file size limit."
\ No newline at end of file
diff --git a/i18n/qqq.json b/i18n/qqq.json
index fcd6857..b4443be 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -52,5 +52,6 @@
        "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-filemissinginrevision": "Error message shown when the 
file contains at least one revision with a missing image file.",
        "fileimporter-filetoolarge": "Text shown when a user tries to upload a 
file (or file revision) which exceeds the maximum file size limit."
diff --git a/src/Remote/MediaWiki/ApiDetailRetriever.php 
index 5c7679c..762d83b 100644
--- a/src/Remote/MediaWiki/ApiDetailRetriever.php
+++ b/src/Remote/MediaWiki/ApiDetailRetriever.php
@@ -296,6 +296,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'] = 

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia354f24315b89279a010dee494ca82ee9049e7d5
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/FileImporter
Gerrit-Branch: master
Gerrit-Owner: Andrew-WMDE <>
Gerrit-Reviewer: Addshore <>
Gerrit-Reviewer: Andrew-WMDE <>
Gerrit-Reviewer: Siebrand <>
Gerrit-Reviewer: Tobias Gritschacher <>
Gerrit-Reviewer: WMDE-Fisch <>
Gerrit-Reviewer: jenkins-bot <>

MediaWiki-commits mailing list

Reply via email to