Decide & implement FileImporter behaviour when suppressed FILE revision data needs to be imported
Closed, ResolvedPublic

Description

Currently when the extension comes across a file that has suppressed content in its revisions the import will fail with some bad errors.

  1. Find out what content can be suppressed in file revisions
  2. Replace said suppressed content with a message such as "Suppressed content removed by FileImporter" like in T162255

A file with suppressed content is: https://commons.wikimedia.org/wiki/File:Labs_Tools_topology.png

Test images on testwiki:

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 22 2017, 2:45 PM
Addshore updated the task description. (Show Details)Sep 1 2017, 8:25 AM
Addshore updated the task description. (Show Details)Sep 1 2017, 8:31 AM
Addshore updated the task description. (Show Details)

@Addshore @Tobi_WMDE_SW @WMDE-Fisch When a file revision has the "filehidden" flag set (Hidden file content) should we exclude that revision from the import or should we come up with a placeholder image to add instead?

Thats probably worth discussing in our next meeting!

No conclusion yet how we should handle this case. We will look into it more, to see if there's a way in MediaWiki to deal with it.

@Addshore @Tobi_WMDE_SW @WMDE-Fisch When a file revision has the "filehidden" flag set (Hidden file content) should we exclude that revision from the import or should we come up with a placeholder image to add instead?

So, after a short discussion with @Bmueller here's what we suggest:

  • When a user tries to import a file which has a file revision with the filehidden flag set, don't allow the import and show an error with a nice explanation. @Jan_Dittrich, can the UX team come up with a nice error message for this?
  • If it turns out later that there are more than just a few of these cases, we can still add the functionality to allow the import without these revisions but show a warning to the user explaining that some information will get lost with the import.
  • However, we can still spend some time during this sprint looking into Mediawiki to find out if there's a way we haven't found yet to keep these revisions.

Sounds good!

> @Jan_Dittrich, can the UX team come up with a nice error message for this?

I lack the domain knowledge of what a hidden revision causes and by what it is caused. So I doubt that I am the ideal person to write it. From my current knowledge I would suggest
"The file can't be imported because at least one of its revisions is hidden (filehidden flag set)"

(We could tell more about the reasons but it would be in the direction of "We would have liked to make it work, but it is really tricky to make this work…" which is not really helpful for users.)

Change 378323 had a related patch set uploaded (by Andrew-WMDE; owner: Andrew-WMDE):
[mediawiki/extensions/FileImporter@master] [WIP] FileImporter behaviour when suppressed FILE revision data needs to be imported

https://gerrit.wikimedia.org/r/378323

Change 378323 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] FileImporter behaviour when suppressed FILE revision data needs to be imported

https://gerrit.wikimedia.org/r/378323