Fix duplication of uri when the value of a format already contains one #1033
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trello Card #
Ref. #986
The AsterPlot feature introduced a bug in some formats due to a duplication of the URI in the query URL.
It's the case with the LodexField format, which has a value equals to:
https://publication-language.data.istex.fr/api/export/jsonallvalue?uri=ark:/67375/KM1-FNPPMN4Q-S
Due to the similar resources feature introduced by the AsterPlot format, we needed to pass the current resource URI to get similar resources. And we decided to do it for all formats.
But as a result, when the base URL already contains a URI, we have the following duplication:
https://publication-language.data.istex.fr/api/export/jsonallvalue?uri=ark:/67375/KM1-FNPPMN4Q-S?uri=uid%3A%2F12WDH7ZW
So we need to change the default behaviour to inject the uri only when it's necessary (and so currently only in the AsterPlot format).
Todo
Screenshots