Skip to content

Addressbooks CardDav Backend "createUid" has a strange behaviour and nearly always finds a conflict #229

@kellertobias

Description

@kellertobias

See Code
https://github.com/nextcloud/server/blob/master/apps/dav/lib/CardDAV/CardDavBackend.php#L851

shouldn't this be a andWhere instead of where?

It is called by createUid and my mysql log shows that owncloud always only queries for the addressbookId instead of addressbookId and uri.

Because of this I cannot create a new Addressbook Entry with this code:


$cm = \OC::$server->getContactsManager();
$result = $cm->search($LABEL, array('LABEL')); //Returns nothing as Expected;
$entry = $result[0] || array();

$entry["FN"] = "My Name";
... more stuff ...
$cm->createOrUpdate($entry, $addrbookkey);

  • this calles createOrUpdate
  • then runs in the create branch
  • then calls createUid and hangs there

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions