WordPress / openverse-frontend

The gateway to the Openverse. Openverse is a search tool for CC-licensed and public domain content across the internet.
https://wordpress.org/openverse
MIT License
72 stars 64 forks source link

"Back to search results" link does not appear on localized pages #1345

Closed AetherUnbound closed 2 years ago

AetherUnbound commented 2 years ago

Description

When viewing a single result from a search page in a localized version of the site, the "Back to search results" button does not show up.

Reproduction

  1. Visit https://search-staging.openverse.engineering/it/search/?q=gary
  2. Click on a result
  3. Observe that the "Back to search results" button is missing

Screenshots

https://user-images.githubusercontent.com/10214785/165648443-6d3b801c-66d8-4770-9d18-10e4e5628aca.mp4

Additional context

May be related to #1266. Originally reported by @krysal.

Resolution

obulat commented 2 years ago

This is probably caused by the fact that we are matching routes by names, not by paths. And localized routes have names like index__en, so the string matching is probably off for them.

sarayourfriend commented 2 years ago

Looks like you're probably right Olga!

https://github.com/WordPress/openverse-frontend/blob/1eefeaeb91dda34ec6e26bebc727e1bf4881dde8/src/components/VBackToSearchResultsLink.vue#L38