Problem/Motivation
facebook/graph-sdk is a dependency of socialfeed, but it has been moved to: facebookarchive/php-graph-sdk and hasn't been updated in 2 years. It also doesn't support PHP 8: "php": "^5.4|^7.0"
See this issue regarding php 8 compatibility: https://github.com/facebookarchive/php-graph-sdk/issues/1217
Steps to reproduce
composer install fails on php 8.
Proposed resolution
Not sure. Fork the package and change the php requirements? It doesn't look like Facebook has an updated package, since they still link to the archive package here: https://developers.facebook.com/docs/graph-api/guides/our-sdks
Facebook also has https://github.com/facebook/facebook-php-business-sdk but that might require modifying the api calls.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3295588-12-Make-FacebookPostCollector-conform-to-Drupal.patch | 13.9 KB | daniel_j |
Issue fork socialfeed-3295588
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
spuky commentedmaybe a solution would be to use:
https://github.com/janu-software/facebook-php-sdk
that seems to be a php 8 fork of the archived SDK
https://github.com/facebookarchive/php-graph-sdk/issues/1217#issuecommen...
Comment #4
spuky commentedI Added a merge Request.. that is doing that... since janusoftware fork of the SDK is php 8 only it might be better to have a version 2.x of the module for php 8
Comment #5
spuky commentedComment #6
Katy Jockelson commentedHey @spuky
I am running into the same issue - can't run composer update because we're on PHP 8.
Is there a temp fix?
Comment #7
spuky commentedI put a patched version with my changes in my custom modules folder adding it to my codebase (till there is a solution)
and just required the dependencys with composer...
Comment #8
spuky commentedbetter alternative would be:
adding the following entry as first entry in your repository section of your composer json...
must be before:
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
to get higher priority than d.o Repo....
and then:
composer require drupal/socialfeed:1.4.0.pl3295588
composer require abraham/twitteroauth:^4.0
composer require espresso-dev/instagram-basic-display-php:^1.1
composer require janu-software/facebook-php-sdk:^0.1
composer require nesbot/carbon: ^2.59
to get the version with my pull request..
moved my solution to that method
Edit: added composer require for dependencys since composer is not getting them from the git package
Comment #9
shawn dearmond commentedI'm not a huge fan of using some random fork. It's not just a fork because he's made several commits to it. I'd rather use an official library.
Comment #10
spuky commentedTotally get that.. and i was mostly going down that route...
to get my composer installs working...
because until 2 weeks ago composer was installing the facebook project without make a fuzz about php version
so my mr at least helps people running php 8 already
Would love to have an alternative mr using the fb business sdk
Comment #11
spuky commentedComment #12
daniel_j commentedI don't have write access to the issue branch, so I created this patch to bring the commit in #11 into conformance with Drupal coding standards.
Comment #13
spuky commented@daniel_j
Thanks for the patch... forgot to set Drupal code style in PHP storm when setting up the project
your patch wouldn't apply in php storm so i set code formatting to drupal and reformatted the file...
if there are any other code style issues not fixed just point hem out
I am still hoping someone else will come up with a solution that is based on an official facebook library but I don't have the time to dig into that right now..
Comment #14
wim leersWith PHP 7.4 going unsupported in ~2 months (see https://www.php.net/supported-versions.php), this really is critical.
Comment #15
lbrassaw commentedIs there an update on this? Is this patch going to be merged into any near future release?
PHP 7.4 is now one month away from being unsupported!
I'd really love to continue to use this module, rather than trying to find anther to fit the foot.
Many thanks!
Comment #16
spuky commentedI am using the patched Version in production and would RTBC it if I had not wrote it.
I understand that People dislike the idea to use not the official FB lib.
I am setting this to needs review... If there are volunteers willing to transfer the functionality to the FB Business api libs or write the guzzle requests themself's come forward... and set it back to needs work
Setting this to needs review... so we can maybe get RTBC
Comment #17
daniel_j commentedWorks here. Moving to RTBC to expedite merge.
Comment #18
daniel_j commentedComment #19
hemangi.gokhaleThank you, everyone, for all your efforts. I agree with @Shawn DeArmond that using an unofficial library won't be an appropriate solution as we cannot guarantee:
Hence, I've tried my best to develop an MVP for now & can confirm that it's working with one of the production sites at D9 with PHP 8. Feel free to try it out.
composer require 'drupal/socialfeed:^2.0@beta'