Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
schnitzi99 opened this issue Jul 23, 2023 · 1 comment

Comments

@schnitzi99
Copy link

schnitzi99 commented Jul 23, 2023

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. :)

@mstilkerich
Copy link
Owner

mstilkerich commented Jul 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants