Closed tabennett closed 6 years ago
Thanks for reporting this. Unfortunately just switching the order is not enough, as it will cause foreign keys which are calculated from the relationship itself to be overridden by previous values.
We need to support both way, by comparing the relationship & the foreignKey attribute to the entity's original state in cache. We can probably assume the user intente if one or the other is changed, and drop an exception if both have been updated.
Do you think you can provide more details about the context (which relationship is used, some userland code) ?
Pushed a fix : https://github.com/analogueorm/analogue/pull/215
Can you confirm me it works on your project ?
Just pulled it down and all tests are green now! 👍 Thanks Remi!
Since upgrading to 5.5, this line in
analogue/src/System/Aggregate.php
is now breaking our tests:The order needs to be switched there, otherwise there's no way to set foreign keys on the entity because they'll always be overridden with null values: