mstilkerich / rcmcarddav

CardDAV plugin for RoundCube Webmailer
GNU General Public License v2.0
257 stars 81 forks source link

PHP error: "Void must be compatible with..." #340

Closed halacs closed 3 years ago

halacs commented 3 years ago

Hi,

I just updated to the most recent 1.4.11 Roundcube stable version. When I try to open the addressbook I get empty webpage and below error message in the error.log file. Do you have idea how to fix? Thanks!

[09-Apr-2021 12:44:46 Europe/Berlin] PHP Fatal error: Declaration of MStilkerich\CardDavAddressbook4Roundcube\SyncHandlerRoundcube::addressObjectChanged(string $uri, string $etag, Sabre\VObject\Component\VCard $card): void must be compatible with MStilkerich\CardDavClient\Services\SyncHandler::addressObjectChanged(string $uri, string $etag, ?Sabre\VObject\Component\VCard $card): void in /mnt/www/xxxx.tld/my/public_html/mail/plugins/carddav/src/SyncHandlerRoundcube.php on line 17

mstilkerich commented 3 years ago

The version of carddavclient is not compatible with the version of rcmcarddav. If you use composer, this should not happen. Anyway, to fix this run composer update --no-dev in the roundcube directory, assuming you used composer installation method.

halacs commented 3 years ago

Thanks for the prompt response! I did so but nothing changed.

mail/# php composer.phar update --no-dev
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies
Generating autoload files
1 package you are using is looking for funding.
Use the `composer fund` command to find out more!

composer.json

{
    "name": "roundcube/roundcubemail",
    "description": "The Roundcube Webmail suite",
    "license": "GPL-3.0+",
    "repositories": [
        {
            "type": "composer",
            "url": "https://plugins.roundcube.net"
        }
    ],
    "require": {
        "php": ">=5.4.0 <8",
        "pear/pear-core-minimal": "~1.10.1",
        "pear/auth_sasl": "~1.1.0",
        "pear/net_idna2": "~0.2.0",
        "pear/mail_mime": "~1.10.0",
        "pear/net_smtp": "~1.8.1",
        "pear/crypt_gpg": "~1.6.3",
        "pear/net_sieve": "~1.4.3",
        "roundcube/plugin-installer": "~0.2.0",
        "masterminds/html5": "~2.5.0",
        "endroid/qr-code": "~1.6.5",
        "roundcube/carddav": "v4.x-dev"
    },
    "require-dev": {
        "phpunit/phpunit": "^4.8.36 || ^5.7.21"
    },
    "suggest": {
        "mkopinsky/zxcvbn-php": "^4.4.2 required for Zxcvbn password strength driver"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}
mstilkerich commented 3 years ago

Please adapt your dependency to the plugin. The v4 dev branch does not exist anymore and was a development version only. You can use * if you just want the latest version (backwards incompatible changes might occur to 5.0 some day long in the future), or ^4.0.0 to get the latest v4 release, which is 4.1.1 at the moment.

halacs commented 3 years ago

Thanks, this solved my issue. I switched to ^4.0.0. It is not fully clear what I can loose if I use * to use the most recent version.

mstilkerich commented 3 years ago

Well * would simply use the most recent version compatible with the other version constraints. My only point was that it would upgrade you also to a new major version (for example from 4.x to 5.x), which may contain backwards incompatible changes, for example feature removal (so you should check the changelog in case there is something to do concerning the upgrade). Otherwise, there is nothing to loose.