core icon indicating copy to clipboard operation
core copied to clipboard

Relations deleted

Open kouz75 opened this issue 8 months ago • 4 comments

Hi

Publishing content may removed Relations.

Steps to reproduce

Create 3 contents type with one object of each type

TypeA

TypeB with a relation with TypeA

TypeC with a relation with TypeB

Publishing an item of TypeB will remove the relation between C and B

When B is publish, the function updateRelation will remove the relation with object C. -> During publishing process , Bolt remove all relation "from" and "to" object B and recreate only the relation from object B to A

Expected result

During publishing process, Bolt should only manage relation "from" current object.

kouz75 avatar Mar 31 '25 11:03 kouz75

Hello,

What installation method are you using?

What version of Bolt are you using?

What version of PHP are you using?

macintoshplus avatar Mar 31 '25 15:03 macintoshplus

Hi, I experienced similar relation deletion in the Bolt 5.1 and PHP 8.1.

Steps to reproduce:

  1. X has relation to Y
  2. Update and save Y
  3. X has no longer relation to Y

I then need to manually go to X and redo the relation to Y to make it work, which not the best...

Vondry avatar Apr 01 '25 19:04 Vondry

Hi, I use bolt 5.1.24 with php 8.2

in function updateRelation, findRelations retrieve relations From and To the current object. I think bolt should only take care of relations from the current object. because we can have a lot of object pointing to the current one.

kouz75 avatar Apr 02 '25 09:04 kouz75

Hi @kouz75,

I just tested the issue on the latest Bolt 5.2 and the relation deletion is no longer hapenning. I compared the source code and the updateRelation was indeed updated.

So I guess let's try to update to the latest version and If all is good, we can close this issue.

Vondry avatar Apr 27 '25 19:04 Vondry