get only vcards which match both the address book id and the vcard uri (#25294)
This commit is contained in:
parent
2b0f053126
commit
5ace6b53f3
|
@ -848,7 +848,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
||||||
$query = $this->db->getQueryBuilder();
|
$query = $this->db->getQueryBuilder();
|
||||||
$query->select('*')->from($this->dbCardsTable)
|
$query->select('*')->from($this->dbCardsTable)
|
||||||
->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
|
->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
|
||||||
->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
|
->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
|
||||||
$queryResult = $query->execute();
|
$queryResult = $query->execute();
|
||||||
$contact = $queryResult->fetch();
|
$contact = $queryResult->fetch();
|
||||||
$queryResult->closeCursor();
|
$queryResult->closeCursor();
|
||||||
|
|
|
@ -606,6 +606,10 @@ class CardDavBackendTest extends TestCase {
|
||||||
$this->assertSame(5489543, (int)$result['lastmodified']);
|
$this->assertSame(5489543, (int)$result['lastmodified']);
|
||||||
$this->assertSame('etag0', $result['etag']);
|
$this->assertSame('etag0', $result['etag']);
|
||||||
$this->assertSame(120, (int)$result['size']);
|
$this->assertSame(120, (int)$result['size']);
|
||||||
|
|
||||||
|
// this shouldn't return any result because 'uri1' is in address book 1
|
||||||
|
$result = $this->backend->getContact(0, 'uri1');
|
||||||
|
$this->assertEmpty($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetContactFail() {
|
public function testGetContactFail() {
|
||||||
|
|
Loading…
Reference in New Issue