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 8.2 dynamic properties deprecation warnings #1445

Closed
AaronVanGeffen opened this issue Jan 27, 2023 · 11 comments
Closed

PHP 8.2 dynamic properties deprecation warnings #1445

AaronVanGeffen opened this issue Jan 27, 2023 · 11 comments

Comments

@AaronVanGeffen
Copy link

AaronVanGeffen commented Jan 27, 2023

In PHP 8.2, dynamic class properties have been deprecated. Apparently, Sabre\DAV still uses some in at least two locations, leading to errors below.

Baikal is working again after quickly patching the two classes. I do not currently have time to upstream my changes, but I thought I'd report these findings either way, in case others run into similar issues. For visibility, I have also filed an issue with Baikal: sabre-io/Baikal#1154

PHP message: ErrorException: Creation of dynamic property Sabre\DAV\Xml\Property\Href::$autoPrefix is deprecated in /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/PropertyStorage/Backend/PDO.php:100
Stack trace:
#0 [internal function]: Baikal\Framework::exception_error_handler()
#1 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/PropertyStorage/Backend/PDO.php(100): unserialize()
#2 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/PropertyStorage/Plugin.php(84): Sabre\DAV\PropertyStorage\Backend\PDO->propFind()
#3 /usr/share/webapps/baikal/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\PropertyStorage\Plugin->propFind()
#4 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/Server.php(1052): Sabre\DAV\Server->emit()
#5 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/Server.php(984): Sabre\DAV\Server->getPropertiesByNode()
#6 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/Server.php(1662): Sabre\DAV\Server->getPropertiesIteratorForPath()
#7 /usr/share/webapps/baikal/v
PHP message: ErrorException: Creation of dynamic property Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::$addressDataProperties is deprecated in /usr/share/webapps/baikal/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php:104
Stack trace:
#0 /usr/share/webapps/baikal/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php(104): Baikal\Framework::exception_error_handler()
#1 [internal function]: Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::xmlDeserialize()
#2 /usr/share/webapps/baikal/vendor/sabre/xml/lib/Reader.php(234): call_user_func()
#3 /usr/share/webapps/baikal/vendor/sabre/xml/lib/Reader.php(75): Sabre\Xml\Reader->parseCurrentElement()
#4 /usr/share/webapps/baikal/vendor/sabre/xml/lib/Service.php(129): Sabre\Xml\Reader->parse()
#5 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/CorePlugin.php(679): Sabre\Xml\Service->parse()
#6 /usr/share/webapps/baikal/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpReport()
@phil-davis
Copy link
Contributor

PR #1446 fixes the addressDataProperties problem.

I don't see where the autoPrefix stuff happens any more. PR #801 looks like it removed that back in 2016.
Is there some remnant of it still in the code?
@DeepDiver1975 @staabm do you know anything about autoPrefix ?

@staabm
Copy link
Member

staabm commented Jan 30, 2023

do you know anything about autoPrefix ?

Nope

@AaronVanGeffen
Copy link
Author

PR #1446 fixes the addressDataProperties problem.

Thanks. Good to hear.

I don't see where the autoPrefix stuff happens any more. PR #801 looks like it removed that back in 2016. Is there some remnant of it still in the code?

Most likely. Baikal still uses DAV 4.3.0, but that's new enough to include the changes from 2016.

@mokraemer
Copy link

Same issues here.
Maybe use https://github.com/phan/phan to ommit those errors

@murraycollingwood
Copy link

murraycollingwood commented Mar 17, 2023

I've just upgraded to PHP 8.2 and getting these errors.
Currently I'm using "sabre/dav": "@stable"
(sabre/dav 4.4.0 WebDAV Framework for PHP)

Rather than fixing them directly, is there a composer version I can install?
Cheers
Murray

UPDATE: So I'm now using "dev-master", but I'm still getting error messages:
[18-Mar-2023 00:35:54 Australia/Brisbane] SABRE(s) exception: 8192 Creation of dynamic property Sabre_CalDAV_Principal_Collection::$principalPrefix is deprecated (/home/sobs/build/Sabre/DAVACL/AbstractPrincipalCollection.php : 56)

@TCB13
Copy link

TCB13 commented May 8, 2023

The fix here sabre-io/Baikal#1154 (comment) is what should be added.

@DeepDiver1975
Copy link
Member

Issues have been solve - new release will follow #1493

@AaronVanGeffen
Copy link
Author

AaronVanGeffen commented Nov 21, 2023

One of the two issues still remains:

2023/11/21 19:05:43 [error] 566#566: *20360 FastCGI sent in stderr:
"PHP message: ErrorException: Creation of dynamic property Sabre\DAV\Xml\Property\Href::$autoPrefix is deprecated in /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/PropertyStorage/Backend/PDO.php:100
Stack trace:
#0 [internal function]: Baikal\Framework::exception_error_handler()
#1 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/PropertyStorage/Backend/PDO.php(100): unserialize()
#2 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/PropertyStorage/Plugin.php(84): Sabre\DAV\PropertyStorage\Backend\PDO->propFind()
#3 /usr/share/webapps/baikal/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\PropertyStorage\Plugin->propFind()
#4 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/Server.php(1052): Sabre\DAV\Server->emit()
#5 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/Server.php(984): Sabre\DAV\Server->getPropertiesByNode()
#6 /usr/share/webapps/baikal/vendor/sabre/dav/lib/DAV/Server.php(1662): Sabre\DAV\Server->getPropertiesIteratorForPath()
#7 /usr/share/webapps/baikal/v" while reading response header from upstream

The fix is still what I reported back in February: sabre-io/Baikal#1154 (comment)

* Add `protected $autoPrefix;` to the `Href` class (`baikal/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php`)

@mokraemer
Copy link

can you reopen this bug, or will you file a new one? if it is closed, I don't think they'll see the comments.

@DeepDiver1975
Copy link
Member

We track this in the open Baikal issue.

@phil-davis
Copy link
Contributor

Release https://github.com/sabre-io/dav/releases/tag/4.5.1 should have fixed the HRef autoPrefix problem.

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

7 participants