Skip to content

Commit

Permalink
improve and align replacement of variable
Browse files Browse the repository at this point in the history
  • Loading branch information
floriangantner committed Aug 18, 2023
1 parent 6224aaa commit fbec539
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import static org.dspace.content.Item.ANY;

import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -49,6 +50,7 @@
import org.dspace.profile.OrcidSynchronizationMode;
import org.dspace.profile.service.ResearcherProfileService;
import org.dspace.services.ConfigurationService;
import org.dspace.util.UUIDUtils;
import org.springframework.beans.factory.annotation.Autowired;

/**
Expand Down Expand Up @@ -233,7 +235,7 @@ private Iterator<Item> checkRelation(Context context, Item profile, Item item, S
DiscoverQuery discoverQuery = new DiscoverQuery();
discoverQuery.setDSpaceObjectFilter(IndexableItem.TYPE);
discoverQuery.addFilterQueries("search.resourceid:" + item.getID());
filterrelationname = filterrelationname.replace("{0}", profile.getID().toString());
filterrelationname = MessageFormat.format(filterrelationname, UUIDUtils.toString(profile.getID()));
discoverQuery.addFilterQueries(filterrelationname);
discoverQuery.setMaxResults(1);
return new DiscoverResultItemIterator(context, discoverQuery);
Expand Down

0 comments on commit fbec539

Please sign in to comment.