4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
43 stars 62 forks source link

Migration: migrated relationships are not editable #329

Closed floriangantner closed 1 year ago

floriangantner commented 1 year ago

Describe the bug Following the normal migration procedure, the former relationpreferences are migrated to relationship(s) in some way that they cannot be edited after the migration.

To Reproduce Steps to reproduce the behavior:

  1. Apply the migration procedure as describe in the documentation.
  2. Apply the migration_post_import procedure with: -> some previous relationpreference configured with values (e.g. preferred/hidden Publication for some Person) -> and the corresponding relationship configured in the migration excel and in dspace7.
  3. Then check the table relationship. Entries exist and the column type_id is not empty, whereas columns leftward_value and rightward_value are empty.

4a. Futher investigations: Since some of the newer releases this will lead to some error if you call the edit-relationships which expect the leftward/rightward Value to be not null, e.g. edit the relations for some Person. On the one hand the frontend will log on the console

ERROR TypeError: filteredRelationship.leftwardValue is null
    hiddenRelationships edit-item-relationships.component.ts:247
    retrieveRelationships edit-item-relationships.component.ts:247

4b. whereas on the other hand modifying the relationship and try to save the relationship will lead to some log error like :

Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into public.relationship (latest_version_status, left_id, left_place, leftward_value, type_id, right_id, right_place, rightward_value, id) values (0, '68a1bc41-f4cf-47ff-b909-bb7b4123c6e1'::uuid, -1, 'isPublicationSelectedFor', 12, '6d6f5d54-033d-4906-b894-8d98b4cfef91'::uuid, -1, 'hasSelectedPublications', 384) was aborted: ERROR: duplicate key value violates unique constraint "u_constraint"
  Detail: Key (left_id, type_id, right_id)=(68a1bc41-f4cf-47ff-b909-bb7b4123c6e1, 12, 6d6f5d54-033d-4906-b894-8d98b4cfef91) already exists.  Call getNextException to see other errors in the batch.

Expected behavior We expect the columns to be filled in the migration procedure. The columns are actually not mentioned in the pentaho skript to be set in the relationship table.

Related work Link to any related tickets or PRs here.