Merge pull request #2452 from nextcloud/stable10-1826
[stable10] Fix post_unshareFromSelf hook parameter format
This commit is contained in:
commit
ed71ecc2b2
|
@ -122,4 +122,26 @@ class GroupEtagPropagationTest extends PropagationTestCase {
|
||||||
|
|
||||||
$this->assertAllUnchanged();
|
$this->assertAllUnchanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testRecipientUnsharesFromSelf() {
|
||||||
|
$this->loginAsUser(self::TEST_FILES_SHARING_API_USER2);
|
||||||
|
$this->assertTrue(
|
||||||
|
$this->rootView->unlink('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test')
|
||||||
|
);
|
||||||
|
$this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER2]);
|
||||||
|
|
||||||
|
$this->assertAllUnchanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testRecipientUnsharesFromSelfUniqueGroupShare() {
|
||||||
|
$this->loginAsUser(self::TEST_FILES_SHARING_API_USER2);
|
||||||
|
// rename to create an extra entry in the share table
|
||||||
|
$this->rootView->rename('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test', '/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test_renamed');
|
||||||
|
$this->assertTrue(
|
||||||
|
$this->rootView->unlink('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test_renamed')
|
||||||
|
);
|
||||||
|
$this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER2]);
|
||||||
|
|
||||||
|
$this->assertAllUnchanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ class Share extends Constants {
|
||||||
if (isset($groupShare['file_target'])) {
|
if (isset($groupShare['file_target'])) {
|
||||||
$shareTmp['fileTarget'] = $groupShare['file_target'];
|
$shareTmp['fileTarget'] = $groupShare['file_target'];
|
||||||
}
|
}
|
||||||
$listOfUnsharedItems = array_merge($listOfUnsharedItems, array($groupShare));
|
$listOfUnsharedItems = array_merge($listOfUnsharedItems, [$shareTmp]);
|
||||||
$itemUnshared = true;
|
$itemUnshared = true;
|
||||||
} elseif (!$itemUnshared && isset($uniqueGroupShare)) {
|
} elseif (!$itemUnshared && isset($uniqueGroupShare)) {
|
||||||
$query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = ? WHERE `id` = ?');
|
$query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = ? WHERE `id` = ?');
|
||||||
|
@ -1074,7 +1074,7 @@ class Share extends Constants {
|
||||||
if (isset($uniqueGroupShare['file_target'])) {
|
if (isset($uniqueGroupShare['file_target'])) {
|
||||||
$shareTmp['fileTarget'] = $uniqueGroupShare['file_target'];
|
$shareTmp['fileTarget'] = $uniqueGroupShare['file_target'];
|
||||||
}
|
}
|
||||||
$listOfUnsharedItems = array_merge($listOfUnsharedItems, array($uniqueGroupShare));
|
$listOfUnsharedItems = array_merge($listOfUnsharedItems, [$shareTmp]);
|
||||||
$itemUnshared = true;
|
$itemUnshared = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue