[stable8.2] Fix post_unshareFromSelf hook parameter format#26364
[stable8.2] Fix post_unshareFromSelf hook parameter format#26364
Conversation
|
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @schiessle, @icewind1991 and @nickvergessen to be potential reviewers. |
|
@SergioBertolinSG mind checking whether we have integration tests for etag propagation (I'm sure we do) and whether they cover these scenarios ? Since we backported most tests it seems that this situation wasn't caught. |
|
When unsharing from self in a group share situation, the share items passed to the post_unshareFromSelf hook were using the wrong format in which the attribute names (ex: "share_type") have non camel-case format. This fix makes sure that in group sharing case we use the correct format. It looks like the code was already producing it but in array_merge it was not using it and adding the unprocessed one.
0231100 to
e7cb4ac
Compare
|
Adjusted unit tests, now it looks better. |
| $shareTmp['fileTarget'] = $groupShare['file_target']; | ||
| } | ||
| $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($groupShare)); | ||
| $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($shareTmp)); |
There was a problem hiding this comment.
Taking into account we don't really care about the keys in the resulting array, I think $listOfUnsharedItems[] = $shareTmp should be better.
There was a problem hiding this comment.
I only adjusted it to match what we had in the other block above for the user share. Didn't want to make more changes.
|
👍 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
When unsharing from self in a group share situation, the share items passed to the post_unshareFromSelf hook were using the wrong format in which the attribute names (ex: "share_type") have non camel-case format.
This fix makes sure that in group sharing case we use the correct format. It looks like the code was already producing it but in array_merge it was not using it and adding the unprocessed one
Related Issue
Fixes #26346 for OC 8.2 (specifically)
Motivation and Context
Fixes etag propagation that is triggered by said hook that this fixes, see #26346 (comment)
How Has This Been Tested?
Manual testing with group shares and user shares:
Screenshots (if appropriate):
Types of changes
Checklist:
@DeepDiver1975 @jvillafanez @butonic