Skip to content

Entity lookup doesn't respect Relationship's maximum cardinality on the opposite side #4523

@ybnd

Description

@ybnd

Describe the bug

When a Relationship type is configured with a maximum cardinality, DSpace limits how many of those Relationships a given Entity can have at a time.

This is not reflected in our Entity lookup modals (submission or edit Item), which can lead to confusion:

  • Some Entities that appear between the search results may have reached their limit already
  • The submitter has no way to know which Entity can be linked until they try
  • Once they do try, a generic error notification is shown

To Reproduce

Steps to reproduce the behavior:

  1. Set the right_max_cardinality of isAuthorOfPublication to 1 -- this implies that a Person Entity can only have one related Publication
  2. Submit a new Publication with one Author (A)
  3. Submit another Publication and open the Author lookup modal again
    • You'll see Author A between the search results
    • If you attempt to link it to the new Publication, a server error notification will be shown: Unable to add relationship

Expected behavior

Two possible approaches:

  1. Don't show Entities that have reached their cardinality limit in the lookup modal
    • Would require a new indexing plugin
    • Could still be confusing for someone trying to find a particular Entity, unaware of the cardinality limit
  2. Show all Entities, but disable the "checkbox" for Entities that have reached their cardinality limit (possibly add an explanation as to why)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

🆕 Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions