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

Language negotiation fixes for Skosmos 3 #1458

Merged
merged 6 commits into from
May 25, 2023

Conversation

osma
Copy link
Member

@osma osma commented May 25, 2023

Reasons for creating this PR

Fixes and unit tests for language negotiation were applied to the master branch in PR #1457. This PR applies the same fixes to the skosmos-3 branch. The commits have been cherry-picked and adapted to current Skosmos 3 PHP code style.

Link to relevant issue(s), if any

Description of the changes in this PR

(copied from PR #1457)

  • Upgrade willdurand/negotiation from 3.0.* to 3.1.* because only 3.1 is compatible with PHP 8.1
  • Add handling of cookie values to the Request class
  • Make WebController.guessLanguage use the Request class to access cookies and HTTP header values
  • Implement unit tests for WebController.guessLanguage
  • Fix the language value passed to in_array (from PR UI language negotiation fix #1455)
  • Fix the language tags in skosmos:languages settings in the sample configs for Docker (from PR UI language negotiation fix #1455)

Known problems or uncertainties in this PR

n/a

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

osma and others added 6 commits May 25, 2023 09:57
… GET, POST, SERVER vars)

(cherry picked from commit ccfe475)
Also fixed the language tags in the sample `skosmos:languages` config

(cherry picked from commit 0c5e300)
@osma osma added the bug label May 25, 2023
@osma osma added this to the 3.0 milestone May 25, 2023
@osma osma self-assigned this May 25, 2023
@osma osma changed the title Issue1453 language negotiation skosmos3 Language negotiation fixes for Skosmos 3 May 25, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Patch coverage: 93.33% and project coverage change: +0.49 🎉

Comparison is base (a62b3f2) 69.50% compared to head (6929962) 70.00%.

Additional details and impacted files
@@               Coverage Diff               @@
##             skosmos-3    #1458      +/-   ##
===============================================
+ Coverage        69.50%   70.00%   +0.49%     
- Complexity        1629     1634       +5     
===============================================
  Files               32       32              
  Lines             4280     4290      +10     
===============================================
+ Hits              2975     3003      +28     
+ Misses            1305     1287      -18     
Impacted Files Coverage Δ
src/model/Request.php 77.22% <88.88%> (+7.66%) ⬆️
src/controller/WebController.php 19.87% <100.00%> (+4.43%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@osma osma merged commit ad77cc7 into skosmos-3 May 25, 2023
@osma osma deleted the issue1453-language-negotiation-skosmos3 branch May 25, 2023 07:49
@osma osma modified the milestones: 3.x, 3.0 Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done (verified in test.dev.finto.fi, set Milestone 3.0 for both issue & PR)
Development

Successfully merging this pull request may close these issues.

2 participants