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

Cannot select/sort relationships if more than one hidden relationship exists #375

Closed
floriangantner opened this issue Aug 25, 2023 · 0 comments · Fixed by #376
Closed

Cannot select/sort relationships if more than one hidden relationship exists #375

floriangantner opened this issue Aug 25, 2023 · 0 comments · Fixed by #376
Labels

Comments

@floriangantner
Copy link

floriangantner commented Aug 25, 2023

Describe the bug
In case you have some profile with more than one hidden item/researchoutput, you cannot select/deselect/sort any other relationships
To Reproduce
Steps to reproduce the behavior:

  1. Configure relationship between person and publication (e.g. use default configuration). Go to profile page.
  2. Select two publications/items as selected.
  3. Now select two publications as hidden.
  4. From now on you should only be able to add more hidden publications, but you cannot select more items or deselect/sort existing values.
  5. No error response should occur. in the logs some line similar to this should occur (maybe shortened):
Caused by: java.lang.IllegalArgumentException: List length = -1
	at java.base/java.util.Collections.nCopies(Collections.java:5027)
	at org.dspace.content.RelationshipPlacesIndexingServiceImpl.addRightItemsReferences(RelationshipPlacesIndexingServiceImpl.java:105)
	at org.dspace.content.RelationshipPlacesIndexingServiceImpl.updateRelationReferences(RelationshipPlacesIndexingServiceImpl.java:76)
	at org.dspace.content.RelationshipServiceImpl.updatePlaceInRelationship(RelationshipServiceImpl.java:342)
	at org.dspace.content.RelationshipServiceImpl.deleteRelationshipAndCopyToItem(RelationshipServiceImpl.java:822)

There seems to be some error calculation the places being indexed between relationships.

Expected behavior
We expect the user to be able to select/sort/hide existing Relationships without limitations on the amount of relations per relationshiptype.

Related work
Workaround: occurences of Collections.nCopies in the above mentioned class RelationshipPlacesIndexingServiceImpl might only be called of there are more than 0 entries to copy

PR #377 proofes the behaviour in some test-based manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant