Internetrix / silverstripe-facebook

Implements a Facebook login system to generate Access Tokens
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Deprecated Issue on PHP 8.1 #2

Open prabhoz opened 1 year ago

prabhoz commented 1 year ago

Hi

I'm getting issue [Deprecated] Facebook\FacebookApp implements the Serializable interface, which is deprecated. Implement serialize() and unserialize() instead (or in addition, if support for old PHP versions is necessary)

on php version 8.1 is there any resolve for this?

thanks

Iliain commented 1 year ago

I took a look at this one, it looks like the problem is actually coming from the Facebook SDK this module is using, which has been abandoned for a while now. You can see Serializable being implemented here

Someone has forked the module and has made some fairly recent updates, so you should be able to use it instead: https://github.com/joelbutcher/facebook-php-graph-sdk (Though it still appears to use Serializable, it's a deprecation warning which won't prevent the code from actually working. Putting it in Live mode will hide those for you to to check)

This module was really just designed to add a few extra functions for Silverstripe to interact with the API, so assuming that API still works, you should be able to redo what's in the Helper trait.

Unfortunately this internetrix module is quite out of date, with the development team for the company no longer existing, so this won't see much activity anymore.

Depending on what you need the module to handle, I have another pair of repos that are able to request personal Facebook and Instagram posts (but not those of any managed Pages). One is a Silvertripe module, the other is a NodeJS app that the module is designed to query for its login and access tokens:

https://github.com/Iliain/silverstripe-insta https://github.com/Iliain/insta-auth