Page MenuHomePhabricator

[Bug] Special:Nearby isn't showing thumbnails on Wikidata
Closed, ResolvedPublic

Description

https://www.wikidata.org/wiki/Special:Nearby stopped showing thumbnails. We need to investigate and get them back.

Event Timeline

thiemowmde added subscribers: thiemowmde, Jonas, aude, hoo.

This is what happened, as far as I can see:

  • In November 2016 a heavy breaking change was made to the PageImages extension. Since then it does not use the page_image page property any more by default, but page_image_free.
  • T124225: PageImages should never return non-free images was the motivation for the braking change, but it was not this ticket where the actual change was made.
  • The actual braking change was made later in https://gerrit.wikimedia.org/r/320703, tracked in T131105: Pageimages should return both free and non-free images with 'free-ness' denoted as a property.
  • The old behavior can be restored by adding pilicense=any to the PageImages API request.
  • Special:Nearby can not use this parameter. It purposely depends on the page_image_free property since then and ignores the page_image property completely. This was the whole motivation for the change.
  • The only dependency between Wikibase and the PageImages extension is the fact that Wikibase also sets the page_image property, without depending on any PageImages code. We assumed PageImages will find and use the page property. This assumption now broke.

This means we must teach Wikibase if an image is free or not. We can do this by copying a few lines of code from the PageImages extension (most notably LinksUpdateHookHandler::isImageFree) and then set page_image_free instead of the now dysfunctional page_image if an image is considered "free". (Note: Never set both properties.) Or we must refactor the PageImages code in a way we can use it as a service.

Your best bet would be to set the default license to any for Wikidata which can be achieved once T156190 is complete. There's no reason Special:Nearby on Wikidata should have to use free images and no reason it should be forced to be made aware of them. Does that sound like a plan?

@Jdlrobson, that would be super awesome. Thanks!

Viveksr96 subscribed.

I want to give a try on this issue.

@Viveksr96 go for it ! You'll need to work and comment on T156190 however... not this task.

Change 354713 had a related patch set uploaded (by Aude; owner: Aude):
[mediawiki/extensions/Wikibase@master] Use PageImages::PROP_NAME_FREE page prop for commons media values

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

We need to update configuration like so for this problem to be fixed:

'wgPageImagesAPIDefaultLicense' => [
'default': 'free',
'wikidatawiki': 'any'
]

Change 354713 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Use PageImages::PROP_NAME_FREE page prop for commons media values

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

Change 356171 had a related patch set uploaded (by Aude; owner: Aude):
[operations/mediawiki-config@master] Set wgPageImagesAPIDefaultLicense to 'any' for wikidata

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

Change 356171 merged by jenkins-bot:
[operations/mediawiki-config@master] Set wgPageImagesAPIDefaultLicense to 'any' for wikidata

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

aude claimed this task.
aude removed a project: Patch-For-Review.
aude moved this task from Doing to Done on the User-aude board.

The default behavior of PageImages is Free-only for good reason. The Board of Trustee's Resolution:Licensing_policy says that unauthorized use of copyrighted content (non-free content) must be "minimal" and subject to EDP (Exception Doctrine Policy), and that this may not be circumvented, eroded, or ignored by Wikimedia Foundation officers or staff nor local policies of any Wikimedia project.

The reasons and explanations are lengthy, but in short we have a free-content mission. Our exceptions for non-free content are deliberately more restrictive than what copyright law might permit. We allow some non-free images in articles (and partial-article previews) with significant restrictions, and they may appear in maintenance categories for work purposes such as investigating and cleaning up copyright issues. We don't allow non-free images to decorate links. It looks nice and it's nice to have, but "looks nice" and "nice to have" are exactly were we don't use non-free content. Special:Nearby should not be requesting or serving non-free images. Setting Special:Nearby to actively request that non-free images be included is definitely wrong.

If Special:Nearby is returning non-free images then that needs to be fixed.

If Special:Nearby only returns images from commons(?), then it shouldn't find any non-free images to return. However in that case the code would either be wrong and doing the right thing by accident, or it would be deliberately requesting the inclusion of non-free images as an ugly hack. Either way it is a very bad practice to leave this sort of misleading landmine in the code. It creates an impression that non-free images are supposed to appear here, and a significant risk that some future change will cause them to appear.