org-SCAN / website

Site web du projet
6 stars 0 forks source link

[BUG]Relation undefined id #239

Closed lduf closed 2 years ago

lduf commented 2 years ago

Description of the bug Undefined ID when displaying the relations with a deleted person.

Severity of the bug

Appearance of the bug How this bug happened :

  1. Create a relation between 2 persons
  2. Delete one of the person
  3. Go to relation
  4. BUG

Ø Additional information Filter relations where from and to persons aren't deleted

lduf commented 2 years ago

Same thing on the 'show' (detail) of the non deleted person

lduf commented 2 years ago

The debugging choice made is the complete deletion of all relations. This is not a soft delete but a force delete.

Currently, ->detach() on a relation deletes the pivot. In our case, the pivot is the link table.

If we want to switch with a softDelete on link, we have to change the boot delete of Refugee and do an update on links.deleted_at.

Also look at the query for link index.