Fixed issue when retrieving grants using funderId

This commit is contained in:
George Kalampokis 2020-05-06 18:02:19 +03:00
parent 7784547bea
commit 42b2ff67f6
1 changed files with 6 additions and 2 deletions

View File

@ -169,9 +169,13 @@ public class RemoteFetcher {
completedPath = completedPath.replace("{like}", "");
}
if (externalUrlCriteria.getFunderId() != null) {
String funderId = externalUrlCriteria.getFunderId();
String funderPrefix = externalUrlCriteria.getFunderId().split(":")[0];
String funderId = externalUrlCriteria.getFunderId().replace(funderPrefix + ":", "");
if (funderId.toCharArray()[0] == ':') {
funderId = externalUrlCriteria.getFunderId();
}
try {
funderId = URLEncoder.encode(externalUrlCriteria.getFunderId(), "UTF-8");
funderId = URLEncoder.encode(funderId, "UTF-8");
} catch (UnsupportedEncodingException e) {
logger.error(e.getMessage(), e);
}