ErwinKomen / RU-passim

0 stars 0 forks source link

Bug - Moving Manifestations #768

Closed shariboodts closed 1 month ago

shariboodts commented 1 month ago

When testing the 'moving manifestation' (to merge two manuscripts), I think the following problem arises. Although the transfer of manifestations from ms 1 to ms 2 initially worked fine, the manifestations disappeared when the empty ms 1 was deleted (as in, I think this is what happened). The purpose of the tool is to facilitate easy merging, so this is not what should happen. When moving manifestations, they should become linked to their new location and loose all ties to their old 'manuscript'.

ErwinKomen commented 1 month ago

Testing

I tested this in the development environment, and it is exactly as the PI has noticed:

  1. Move manifestations to new manuscript
    1. Old manuscript is now without manifestations - correct
    2. New manuscript has the new manifestations - correct
  2. Remove the old manuscript
    1. Bad: The old manuscript's manifestations are now 'deleted' completely!

Research

Starting situation for 5543

Manuscript Sermon Sermon.manu MsItm MsItem.manu Codico Codico.manu
5543 77864 NULL 43497 5543 4441 5543
5543 77865 NULL 43498 5543 4441 5543

Situation for 5543, after moving 77864 away

Manuscript Sermon Sermon.manu MsItm MsItem.manu Codico Codico.manu
5543 77864 NULL 43497 5543 4440 5542
5543 77865 NULL 43498 5543 4441 5543
ErwinKomen commented 1 month ago

Resolution

  1. Look at the code in views SermonMove
    1. This looks for the last codicological unit of the destination manuscript
    2. And then it does msitem.move_codico(lastcodico)
  2. Looking at model MsItem, method move_codico()
    1. Added line to adjust the msitem's manu field

Result: now it all works as it should. Problem solved!