fix: preserve link shares on ownership transfer - #64209
Conversation
8a825d4 to
a7c6dfb
Compare
|
/backport to stable35 |
|
/backport to stable34 |
|
/backport to stable33 |
|
/backport to stable32 |
|
Test failures are unrelated, both should be caused by #53048, the psalm one has already been addressed, but the issue with the non-cleared cache is not yet. |
a7c6dfb to
e2f617a
Compare
provokateurin
left a comment
There was a problem hiding this comment.
I'm not sure if this is correct. As far as I understand the parent share is not actually deleted, but transferred, so you're changing the share without it being necessary.
Doesn't this mean, we have to change the order in which shares are transferred? The ones that are the most deeply nested first and the root last, so that deleting the "old" shares doesn't unintentionally delete any shares.
e2f617a to
9a381a3
Compare
Shares are not all transferred. The code is dropping the following redundant share rows:
So in all those cases a share entry is being dropped and, due to the fact that link and email I did miss the fact that we should re-parent links in the case where the user receiving the transfer already has received shares for the same node, is this what you meant? I added a commit to address that. |
Yes, that was mostly my concern. |
CommandLine defines both logic to run occ commands in integration tests as wel as behat steps. This is problematic as if two contexts are loaded and both need the ability to run occ commands, they will cause a conflict due to the steps being defined more than once. Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
9a381a3 to
217eb44
Compare
Summary
This PR fixes an issue on file ownership transfer, which causes link and email shares to be incorrectly dropped.
Link and email shares get their
parentdatabase column set when they come from a reshare, this is used to delete them once the parent share is deleted. During transfer, all shares related to the transferred content are collected and are, in some cases, deleted. The delete triggers the cascade-delete of link and email shares, so they are effectively lost. This PR sets theparentcolumn of the affected shares tonullbefore the main share is deleted, so that the subsequent handling of those shares updates the owner to the user receiving the transfer.Checklist
3. to review, feature component)stable32)AI (if applicable)