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

More proper fix for language changing link URLs #1258

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

osma
Copy link
Member

@osma osma commented Dec 8, 2021

Reasons for creating this PR

The language changing links at the top of the page were no longer working on the front page of Skosmos.

Link to relevant issue(s), if any

Related to PR #1234 (by @schlawiner ) which broke the language changing links on the front page of Skosmos, while fixing situations where the vocabulary ID ended with a language code (e.g. intressen).

Description of the changes in this PR

  • Move the logic to switch the language part of the URL into PHP code (Request->getLangUrl method), so that it can be changed using a regex and tested with unit tests. Make sure to handle both the front page (root URL) case and deeper URLs within Skosmos.
  • Add unit tests for the above method.

Known problems or uncertainties in this PR

n/a

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if not, explain why below)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

Sorry, something went wrong.

@osma osma added the bug label Dec 8, 2021
@osma osma added this to the 2.13 milestone Dec 8, 2021
@osma osma self-assigned this Dec 8, 2021
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #1258 (bd07393) into master (b7fd24e) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1258      +/-   ##
============================================
+ Coverage     69.26%   69.33%   +0.07%     
- Complexity     1646     1647       +1     
============================================
  Files            32       32              
  Lines          4041     4044       +3     
============================================
+ Hits           2799     2804       +5     
+ Misses         1242     1240       -2     
Impacted Files Coverage Δ
model/Request.php 71.26% <100.00%> (+3.40%) ⬆️

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 b7fd24e...bd07393. Read the comment docs.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma merged commit 5b9a75c into master Dec 8, 2021
@osma osma deleted the fix-language-switch-url-take2 branch December 8, 2021 12:21
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.

None yet

1 participant