mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-25 16:04:19 +08:00
Fix Postgres sharing issue #581
Signed-off-by: Florent F <florent.git@zeteo.me>
This commit is contained in:
parent
49edeaf9e2
commit
3cfb3bdf10
3 changed files with 5 additions and 6 deletions
|
@ -74,15 +74,14 @@ class ShareRequestMapper extends QBMapper {
|
|||
* @return Entity[]
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getRequestsByItemGuidGroupedByUser(string $item_guid) {
|
||||
public function getRequestsByItemGuid(string $item_guid) {
|
||||
if (strtolower($this->db->getDatabasePlatform()->getName()) === 'mysql') {
|
||||
$this->db->executeQuery("SET sql_mode = '';");
|
||||
}
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from(self::TABLE_NAME)
|
||||
->where($qb->expr()->eq('item_guid', $qb->createNamedParameter($item_guid, IQueryBuilder::PARAM_STR)))
|
||||
->groupBy('target_user_id');
|
||||
->where($qb->expr()->eq('item_guid', $qb->createNamedParameter($item_guid, IQueryBuilder::PARAM_STR)));
|
||||
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@ class ShareService {
|
|||
* @throws Exception
|
||||
*/
|
||||
public function getCredentialPendingAclList(string $item_guid) {
|
||||
return $this->shareRequest->getRequestsByItemGuidGroupedByUser($item_guid);
|
||||
return $this->shareRequest->getRequestsByItemGuid($item_guid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -112,7 +112,7 @@ class ShareRequestMapperTest extends DatabaseHelperTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* @covers ::getRequestsByItemGuidGroupedByUser
|
||||
* @covers ::getRequestsByItemGuid
|
||||
*/
|
||||
public function testGetRequestsByItemGuidGroupedByUser() {
|
||||
$dataset = $this->findInDataset(
|
||||
|
@ -121,7 +121,7 @@ class ShareRequestMapperTest extends DatabaseHelperTest {
|
|||
$this->dataset->getRow(0)['item_guid']
|
||||
);
|
||||
|
||||
$result = $this->mapper->getRequestsByItemGuidGroupedByUser($dataset[0]['item_guid']);
|
||||
$result = $this->mapper->getRequestsByItemGuid($dataset[0]['item_guid']);
|
||||
|
||||
$this->assertCount(count($dataset), $result);
|
||||
|
||||
|
|
Loading…
Reference in a new issue