Skip to content

Skip image upload to Wikidata (nearby -> green pins) #6349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 22, 2025

Conversation

sonalyadav1
Copy link
Contributor

Description (required)

The current implementation always attempts to upload images to Wikidata, even when the item already has an image (P18 property).

Fixes #6185

What changes did you make and why?

Modified makeWikiDataEdit() to:
-Check wikiDataPlace.imageValue.isNullOrBlank() before uploading
-Skip the upload if an image already exists

Tests performed (required)

Tested {build variant, ProdDebug} on {name of device or emulator} with API level {API level}.

@nicolas-raoul
Copy link
Member

Pictures with "Is this a pic of X?" not added to its P18 anymore, that's great!

I saw a message like "Failed to update Wikidata" once though... that should not happen right?

Copy link

✅ Generated APK variants!

@sonalyadav1
Copy link
Contributor Author

I’ve pushed the latest changes — could you please review them when convenient?

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on 3 sets of images, working great!
Code looks good too.
Thanks a lot for fixing this very important issue, it will make Wikidata P18s much more useful!

@nicolas-raoul nicolas-raoul merged commit 09da7b8 into commons-app:main Jun 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding multiple images to Wikidata is harmful
2 participants