WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
237 stars 188 forks source link

Sources without a URL scheme get directed to an internal reference #471

Open AetherUnbound opened 1 year ago

AetherUnbound commented 1 year ago

Description

Originally reported by @xolotl on the Make WP Slack.

Presently, the iNaturalist source URL on the production sources page is: https://search-production.openverse.engineering/inaturalist.org Screenshot_2023-01-10_11-53-49

It looks like this is because the API's v1/images/stats response is returning the source_url field without a scheme (e.g. inatrualist.org vs https://inaturalist.org): Screenshot_2023-01-10_11-46-42

We could ensure the scheme is added on the frontend, or perhaps we may even want to change this to a URLField instead of just a text field to ensure a scheme is applied. I'm happy to move the issue if the latter is preferred!

Additional context

I plan on fixing this value in the API's Django admin shortly after filing this issue, so it will (hopefully) not be reproducible in production.

zackkrida commented 1 year ago

Thanks for sharing this. My feelings are mixed on how to fix it. I suppose I regard it as a typo; perhaps this could just be solved in documentation. I'm not sure we actually have instructions for the steps to manually add and enable a new source in Openverse, which would be an excellent place for this.

obulat commented 2 weeks ago

I like the idea of converting the text field to a URL field as that would validate it and be a more certain solution than adding documentation. Is there an argument against it, @zackkrida?

zackkrida commented 2 weeks ago

@obulat that sounds good to me, no argument against it!