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

Misinterpreted function calls for getLiteral in vocabulary config #842

Closed
joelit opened this issue Jan 24, 2019 · 0 comments · Fixed by #843
Closed

Misinterpreted function calls for getLiteral in vocabulary config #842

joelit opened this issue Jan 24, 2019 · 0 comments · Fixed by #843
Assignees
Labels
Milestone

Comments

@joelit
Copy link
Contributor

joelit commented Jan 24, 2019

At which URL did you encounter the problem?

When querying vocabulary info through Skosmos REST API, eg. http://api.finto.fi/rest/v1/yso/?lang=fi

What is the expected output? What do you see instead?

Switching the 'lang' parameter for the vocabulary info query does not change the parts of the response data produced by calls for getLiteral in VocabularyConfig. It is easiest to see when the result for 'title' is not the same in the result for the query and in the result for the concept scheme within the same response.

"id":"yso",
"marcSource":"yso/eng",
"title":"YSO - General Finnish ontology",
"defaultLanguage":"fi",
"languages":["en","fi","sv"],
"conceptschemes":[
{"label":"YSO - Yleinen suomalainen ontologia","title":"YSO - Yleinen suomalainen ontologia","subject":{"uri":"http://www.yso.fi/onto/yso/p19469","prefLabel":"yleisk\u00e4sitteet"},"uri":"http://www.yso.fi/onto/yso/","type":"skos:ConceptScheme"},{"uri":"http://www.yso.fi/onto/yso/aggregateconceptscheme","type":"skos:ConceptScheme"},{"uri":"http://www.yso.fi/onto/yso/deprecatedconceptscheme","type":"skos:ConceptScheme"}
]

Both bolded results should be displayed in the selected language. This is most likely caused by calling BaseConfig's getLiteral($property, $default=null, $lang=null) by $this->getLiteral($property, $lang) within VocabularyConfig.php, which leads to 'lang' being interpreted as the default return value instead of language parameter in the function call.

@joelit joelit added the bug label Jan 24, 2019
@joelit joelit self-assigned this Jan 24, 2019
@osma osma added this to the 2.2 milestone Nov 29, 2019
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 a pull request may close this issue.

2 participants