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

Switching language breaks ?uri= request parameter #1537

Open
plecor opened this issue Oct 27, 2023 · 2 comments · May be fixed by #1542
Open

Switching language breaks ?uri= request parameter #1537

plecor opened this issue Oct 27, 2023 · 2 comments · May be fixed by #1542
Labels
bug size-large more than 2 days Skosmos 2.X Relevant for Skosmos 2

Comments

@plecor
Copy link

plecor commented Oct 27, 2023

URL address of the page where you encountered the problem

https://finto.fi/afo/fi/page/?uri=http://www.yso.fi/onto/afo/ for instance

Description of the problem

Additional information (e.g. screenshots) about the problem

When switching language, the uri parameter changes from uri=http://www.yso.fi/onto/afo/ to uri=http//www.yso.fi/onto/afo/ (the :after http is missing).

I believe this is related to

$langurl = str_replace(":", "", $langurl);

Going directly to https://finto.fi/afo/en/page/?uri=http://www.yso.fi/onto/afo/ with a : does work.

@plecor plecor added the bug label Oct 27, 2023
@Vainonen Vainonen linked a pull request Oct 31, 2023 that will close this issue
4 tasks
@osma
Copy link
Member

osma commented Nov 2, 2023

Thanks for the report @plecor !

May I ask how you arrived at the URL https://finto.fi/afo/fi/page/?uri=http://www.yso.fi/onto/afo/ ? Did you get there through some link generated by Skosmos or did you construct this yourself?

There's a problem with this URL that it doesn't URL encode the value of the uri parameter. The URL is thus invalid, but it happens to work anyway - with the exception of the language switching links as you noticed. The correct URL for this page would be https://finto.fi/afo/fi/page/?uri=http%3A%2F%2Fwww.yso.fi%2Fonto%2Fafo%2F which looks a bit uglier but the value of uri is properly encoded. In my understanding, links generated by Skosmos that use the uri parameter should always URL encode the values, but that may not always be the case, there could be a bug somewhere.

@plecor
Copy link
Author

plecor commented Nov 6, 2023

I did indeed construct myself https://finto.fi/afo/fi/page/?uri=http://www.yso.fi/onto/afo/ as an example to mimic our internal setup and its result - but your answer makes me think the issue is on our side.

We followed the example in the doc but we are not using Apache. We likely need to explicitely encode the parameter on our end.

Thanks a lot for your answer.

@MikkoAleksanteri MikkoAleksanteri added the Skosmos 2.X Relevant for Skosmos 2 label Dec 5, 2023
@MikkoAleksanteri MikkoAleksanteri added this to Funnel in NatLibFi Skosmos Backlog via automation Dec 5, 2023
@osma osma moved this from Funnel to Selected for analysis in NatLibFi Skosmos Backlog Dec 5, 2023
@osma osma added the size-large more than 2 days label Dec 5, 2023
@osma osma moved this from Selected for analysis to Analysis and size estimate done in NatLibFi Skosmos Backlog Dec 5, 2023
@osma osma moved this from Analysis and size estimate done to NatLibFi priority Medium in NatLibFi Skosmos Backlog Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug size-large more than 2 days Skosmos 2.X Relevant for Skosmos 2
Projects
NatLibFi Skosmos Backlog
NatLibFi priority Medium
Development

Successfully merging a pull request may close this issue.

3 participants