jenkins-bot has submitted this change and it was merged. ( 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 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(-) Approvals: 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.", "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-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 b/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'] = $wgFileImporterAccountForSuppressedUsername; } -- To view, visit https://gerrit.wikimedia.org/r/403179 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia354f24315b89279a010dee494ca82ee9049e7d5 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/FileImporter Gerrit-Branch: master Gerrit-Owner: Andrew-WMDE <andrew.kos...@wikimedia.de> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Andrew-WMDE <andrew.kos...@wikimedia.de> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: WMDE-Fisch <christoph.jau...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits