When creating addressbooks, make sure the displayname is set
This commit is contained in:
parent
bdd396aa3d
commit
06d1685e75
2 changed files with 8 additions and 1 deletions
|
@ -134,7 +134,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
* @param string $principalUri
|
||||
* @param string $url Just the 'basename' of the url.
|
||||
* @param array $properties
|
||||
* @return void
|
||||
* @throws BadRequest
|
||||
*/
|
||||
function createAddressBook($principalUri, $url, array $properties) {
|
||||
$values = [
|
||||
|
@ -160,6 +160,12 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
|
||||
}
|
||||
|
||||
// Fallback to make sure the displayname is set. Some clients may refuse
|
||||
// to work with addressbooks not having a displayname.
|
||||
if(is_null($values['displayname'])) {
|
||||
$values['displayname'] = $url;
|
||||
}
|
||||
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->insert('addressbooks')
|
||||
->values([
|
||||
|
|
|
@ -60,6 +60,7 @@ class CardDavBackendTest extends TestCase {
|
|||
|
||||
$books = $this->backend->getAddressBooksForUser(self::UNIT_TEST_USER);
|
||||
$this->assertEquals(1, count($books));
|
||||
$this->assertEquals('Example', $books[0]['{DAV:}displayname']);
|
||||
|
||||
// update it's display name
|
||||
$patch = new PropPatch([
|
||||
|
|
Loading…
Reference in a new issue