mstilkerich/rcmcarddav

PHP Fatal error: Uncaught Error: Call to undefined method Sabre\VObject\Component\VCard::getDocumentType()

schnitzi99 opened this issue · 1 comments

Hi all,

I freshly installed Release 5.0.1 from the github-tarball of rcmcarddav on roundcube 1.6.1 running on a Debian 12.1 with php 8.2.
I'm using it to sync the address book from a nextcloud server.

Discovery of the adress books works but after switching to adress book view roundcube crashes with the following error:

roundcube[10874]: PHP Fatal error: Uncaught Error: Call to undefined method Sabre\VObject\Component\VCard::getDocumentType() in /usr/local/roundcube/carddav/src/DataConversion.php:323
roundcube[10874]: Stack trace:
roundcube[10874]: #0 /usr/local/roundcube/carddav/src/SyncHandlerRoundcube.php(345): MStilkerich\RCMCardDAV\DataConversion->toRoundcube()
roundcube[10874]: #1 /usr/local/roundcube/carddav/src/SyncHandlerRoundcube.php(145): MStilkerich\RCMCardDAV\SyncHandlerRoundcube->updateContactCard()
roundcube[10874]: #2 /usr/local/roundcube/carddav/vendor/mstilkerich/carddavclient/src/Services/Sync.php(162): MStilkerich\RCMCardDAV\SyncHandlerRoundcube->addressObjectChanged()
roundcube[10874]: #3 /usr/local/roundcube/carddav/vendor/mstilkerich/carddavclient/src/Services/Sync.php(57): MStilkerich\CardDavClient\Services\Sync->synchronizeOneBatch()
roundcube[10874]: #4 /usr/local/roundcube/carddav/src/Addressbook.php(1248): MStilkerich\CardDavClient\Services\Sync->synchronize()
roundcube[10874]: #5 /usr/local/roundcube/carddav/src/Frontend/AddressbookManager.php(676): MStilkerich\RCMCardDAV\Addressbook->resync()
roundcube[10874]: #6 /usr/local/roundcube/carddav/carddav.php(437): MStilkerich\RCMCardDAV\Frontend\AddressbookManager->resyncAddressbook()
roundcube[10874]: #7 /usr/share/roundcube/program/lib/Roundcube/rcube_plugin_api.php(518): carddav->getAddressbook()
roundcube[10874]: #8 /usr/share/roundcube/program/include/rcmail.php(346): rcube_plugin_api->exec_hook()
roundcube[10874]: #9 /usr/share/roundcube/program/actions/contacts/index.php(560): rcmail->get_address_book()
roundcube[10874]: #10 /usr/share/roundcube/program/actions/contacts/index.php(491): rcmail_action_contacts_index::contact_groups()
roundcube[10874]: #11 /usr/share/roundcube/program/include/rcmail_output_html.php(1484): rcmail_action_contacts_index::directory_list()
roundcube[10874]: #12 [internal function]: rcmail_output_html->xml_command()
roundcube[10874]: #13 /usr/share/roundcube/program/include/rcmail_output_html.php(1322): preg_replace_callback()
roundcube[10874]: #14 /usr/share/roundcube/program/include/rcmail_output_html.php(825): rcmail_output_html->parse_xml()
roundcube[10874]: #15 /usr/share/roundcube/program/include/rcmail_output_html.php(654): rcmail_output_html->parse()
roundcube[10874]: #16 /usr/share/roundcube/program/include/rcmail.php(296): rcmail_output_html->send()
roundcube[10874]: #17 /usr/share/roundcube/index.php(278): rcmail->action_handler()
roundcube[10874]: #18 {main}
roundcube[10874]: thrown in /usr/local/roundcube/carddav/src/DataConversion.php on line 323

sabre-dav and sabre-vobject were both ALSO installed via the debian package management (php-sabre-vobject and php-sabre-dav). When removing both debian packages roundcube and rcmcarddav work just fine.

Thanks for all the work!
It's working like a charm aside from that. :)

Seems like you have solved the problem yourself :-) Actually we had this one not too long ago #441.

The solution is not to install these ancient sabre versions per Debian package, they are simply not compatible with rcmcarddav. Unfortunately they end up in PHP's search path when you install them.

Just checked: The sabre-dav and sabre vobject versions in Debian are from 2015. Wonder why there would be any reason to install these outdated packages nowadays. Nextcloud also includes (a recent version of) sabre dav.