Skip to content
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

Fix "Any language" label not showing in edge case #899

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

danmichaelo
Copy link
Contributor

@danmichaelo danmichaelo commented Nov 12, 2019

Came across an edge case where the search language selector button showed as "undefined"

Skjermbilde 2019-11-12 kl  17 14 03

It only seems to happen when

  1. the UI language (English for instance) is not a valid search language (because we don't have any English vocabularies)
  2. and when no vocabulary has been selected (that is, on the front page), since otherwise the default language for the vocabulary would kick in
  3. and the SKOSMOS_SEARCH_LANG cookie has not been set

This PR fixes the issue for me, but please check if it makes sense. My guess is that [hreflang="anything"] was changed to [hreflang=""] at some point and eventually removed since it's not a valid language code.

@osma osma added the bug label Jan 10, 2020
@osma osma added this to the 2.3 milestone Jan 10, 2020
Fix an edge cases where the label "Any language" on the search bar language
selection button shows as "Undefined" when the UI language is not a valid
search language and no vocabulary has been selected.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Feb 10, 2020

Codecov Report

Merging #899 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #899   +/-   ##
=========================================
  Coverage     57.62%   57.62%           
  Complexity     1489     1489           
=========================================
  Files            32       32           
  Lines          4170     4170           
=========================================
  Hits           2403     2403           
  Misses         1767     1767

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b34b23...f5650ee. Read the comment docs.

@osma
Copy link
Member

osma commented Feb 11, 2020

I looked around in ancient history of the codebase but couldn't find out exactly what happened. In any case, the fix looks sane!

@osma osma merged commit f2a09c7 into NatLibFi:master Feb 11, 2020
@danmichaelo danmichaelo deleted the fix-anylang-label2 branch February 11, 2020 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants