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

Avoid invalid substitutions in translation converter #491

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

litvinovg
Copy link
Member

@litvinovg litvinovg commented Feb 13, 2025

What does this pull request do?

Avoid possible substitutions in translation body if body content matches sparql variable name.
For example if translation string contains a variable with a link
<a href="/fis/individual?uri=http://d-nb.info/gnd/1080328793\">
?uri part match variable name and is being substituted with variable value.
To prevent that new parameterized sparql string is being created before substitution of label value.

How should this be tested?

  • Run extended translation converter test

  • Manual testing:

  1. Create a translation in properties file with body that contains ?uri text
  2. Start VIVO to run translation conversions
  3. Check created translation in http://vitro.mannlib.cornell.edu/default/interface-i18n graph

Interested parties

@VIVO-project/vivo-committers

Reviewers' expertise

Candidates for reviewing this PR should have some of the following expertises:

  1. Java

Reviewers' report template

General comment

A reviewer should provide here comments and suggestions for requested changes if any.

Testing

A reviewer should briefly describe here how it was tested

Code reviewing

A reviewer should briefly describe here which part was code reviewed

@litvinovg litvinovg changed the title Avoid substitution of variables in translation values in translation converter Avoid invalid substitutions in translation converter Feb 13, 2025
Copy link
Contributor

@chenejac chenejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before application of the fix (in TranslationConverter.java) the tests are failing, after application of the fix, the tests are passing. @litvinovg thanks for this. As we discussed at the last committers meeting one review/test of this PR might be enough for merging taking into account its size.

@chenejac chenejac merged commit 14eb3ae into vivo-project:main Feb 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants