sabre-io / xml

sabre/xml is an XML library that you may not hate.
http://sabre.io/xml/
BSD 3-Clause "New" or "Revised" License
516 stars 77 forks source link

PHP message: PHP Fatal error: Type of Sabre\DAV\Xml\Service::$elementMap must be array #267

Closed Offerel closed 10 months ago

Offerel commented 10 months ago

If have tried to upgrade from sabe/xml 2.2.6 to sabre/xml 4.0.4. But i get the error message "PHP message: PHP Fatal error: Type of Sabre\DAV\Xml\Service::$elementMap must be array".

I have replaced the whole folder of 2.2.6 with the contents from 4.0.4. This was never a issue before.

Any idea whats wrong?

staabm commented 10 months ago

Do you have a stacktrace for this error?

Offerel commented 10 months ago

No. I only see this error in nginx error log. I dont know, why this isnt available in PHP error log. Maybe i have disabled error logging in PHP: I will have a look in to that

2023/12/13 14:57:21 [error] 294302#294302: *23929 FastCGI sent in stderr: "PHP message: PHP Fatal error: Type of Sabre\DAV\Xml\Service::$elementMap must be array (as in class Sabre\Xml\Service) in /path/to/www/sabredav/vendor/sabre/dav-4.6.0/lib/DAV/Xml/Service.php on line 14" while reading response header from upstream, client: 188.69.61.136, server: dav.mydomain.com, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "dav.mydomain.com"

phil-davis commented 10 months ago

sabre/dav 4.6.0 does not have the type declarations needed to work with sabre/xml major version 4. There have been various major versions of the dependent repos like sabre/xml sabre/uri etc released over the last year, and those have type declarations throughout the code. But there is still work needed for sabre/vobject and then sabre/dav to get all the type declarations done, and major versions released.

If you use the master branches of sabre/vobject and sabre/dav then there may be enough essential type declarations done for this to work.

I am doing the work as a volunteer - so I don't know when I will get to spend lots of time on it!

Offerel commented 10 months ago

Ahh ok. I assumed something like that. That is fine for me. Then I'll stick with the previous version until it's updated. I think it's absolutely great that this project is being continued at all and I really appreciate it. Without SabreDAV, the base of my entire home server would not exist in its current form. I rely on it a lot. With this in mind, I would like to thank everyone involved in this project.