[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: Handle file revisions that contain a missing image file

2018-01-24 Thread jenkins-bot (Code Review)
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 
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
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: Handle file revisions that contain a missing image file

2018-01-09 Thread Andrew-WMDE (Code Review)
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 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits