4Science / dspace-angular

Angular UI for DSpace and DSpace-CRIS. In the dspace-cris-7 branch you can find the extension to support DSpace-CRIS
BSD 3-Clause "New" or "Revised" License
14 stars 28 forks source link

Couldn't create relationship between Researcher and Publication #16

Open KondratyevAndrey opened 1 year ago

KondratyevAndrey commented 1 year ago

When tries to add a relationship between Researcher and Publication there are an error 422

2023-01-24 09:52:52,338 ERROR 67ec324e-55e4-4ba7-a311-997d9121f306 d1c3bf70-32c9-4d79-ac0b-42e19a712a2b org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ Unprocessable or invalid entity (status:422)

jschultze commented 1 year ago

I think we get the same error. If I follow it correctly, the problem seems to be that one of the two submitted URLs with UUIDs contains "?projection=allLanguages ". So for example those two URLs are send to the REST api:

0 = "http://localhost:8080/server/api/core/items/27d0ae36-1f06-4b9a-9a42-5d1977b9da89?projection=allLanguages " 1 = " http://localhost:8080/server/api/core/items/3e61f79b-dccf-478d-9dce-220fa70d5c1c"

Utils.constructDSpaceObjectList() can not construct a valid item id from the first URL, so the UnprocessableEntityException is thrown.

tomascohen commented 1 year ago

+1

lucasmontoya13 commented 1 year ago

We got the same error. I will describe the steps to get to it :

  1. Prerequisites :

    • Have a community
    • Have a collection of each identity to relate
    • Have both items to relate
  2. Creating a relationship :

    • Select one of the identities involved in the relationship
    • Select the "Options menu" ( ... ) and click on "Administer"
    • Then go to the "Relationships" section
    • Click on the "+Add" button according to the type of the other identity with which you want to establish a relationship.
    • Select the items to be linked
    • At this point you probably got an error like "Unprocessable or invalid entity"
  3. Notes :

    • Possibly the worst error is the fact that the interface shows you the relation exist, but when you check the table "relationship" in the database, there is no any data on it
corrad82-4s commented 11 months ago

Hello, which kind of relationships are you trying to create? Are these relationships stored in relationship_type table? The standard / suggested approach to link researchers and publications is to use authority framework.