[turba] Bug: Saving objects in Turba

Jan Schneider jan at horde.org
Wed Sep 12 15:16:29 UTC 2018


Zitat von Luca Bertoncello <lucabert at lucabert.de>:

> Hi list!
>
> I noticed a very very strange behavior by saving contacts in Turba using the
> API..
>
> I have to function in my program that save contacts.
> The first one add a new contact using this code:
>
>       $registry->callAppMethod('turba',
>                                'davPutObject',
>                                array('args' =>  
> array('contacts~'.$addressbook,
>                                                      $localFile->filename,
>                                                      $vcf->body))
>           );

This API method it supposed to be use by the DAV endpoints only.  
Generally callAppMethod is supposed to be used for Horde internally  
only. Use contacts/import instead.

> the second one changes a contact using this code:
>
>     $registry->call('contacts/replace', array('uid' => $localFile->uid,
>                                               'content' => $vcf->body,
>                                               'contentType' => 'text/vcard',
>                                               'sources' =>
>     $localFile->source));
>
> If I see the documentation these functions have to return true if the data
> were saved correctly and false otherwise.
> Nice, but... they always returns NULL...

Not sure where you see this.

> Could someone explain me how can I check if my program saves the data
> correctly?

Unless it's throwing an Exception, the method worked.

-- 
Jan Schneider
The Horde Project
https://www.horde.org/



More information about the turba mailing list