facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
816 stars 513 forks source link

PHP 8.1 Deprecation #570

Closed davidistores closed 1 year ago

davidistores commented 1 year ago

Facebook PHP Business SDK Issue

Since we want to handle bugs more efficiently, we've decided to close issue reporting in Github and move to our dedicated bug reporting channel. If you encounter a bug with Business SDK (PHP), please report the issue at our developer bug reporting channel.

At this file src/FacebookAds/Object/AbstractCrudObject.php inside the __constructor you are using default valuue "null" for $id that throwing php 8.1 error while trying execute strpos() on null on Line 64

Please change the default vlaue to empty string I guess thanks alot issue-screen-2 issue-screen-1

natewiebe13 commented 1 year ago

Fixed in https://github.com/facebook/facebook-business-sdk-codegen/pull/50

Once the codegen files get imported into this repo, the issue will be resolved.

davidistores commented 1 year ago

How can I resolve it vai composer ?

natewiebe13 commented 1 year ago

Since it's ultimately a fix from another repo, I'd probably tackle it by using patches. If you wanted a purely composer way to do it, I'd probably recommend https://github.com/cweagans/composer-patches

stcheng commented 1 year ago

The latest version has fixed this issue. Thanks.