PHP 8 Compatibility - Facebook sdk php library

Created on 29 July 2022, over 2 years ago
Updated 7 August 2023, over 1 year ago

Problem/Motivation

The facebook library required by this module is not PHP 8 compatible, althou the module itself it is.

When we set the php version to 8.0 in composer.json like

    "config": {
        "platform": {
            "php": "8.0",
         }
     }

And run composer update --lock

We get the following errors:

Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires facebook/facebook-instant-articles-sdk-php == 1.10.2.0 -> satisfiable by facebook/facebook-instant-articles-sdk-php[v1.10.2].
    - facebook/facebook-instant-articles-sdk-php v1.10.2 requires php ^5.4 || ^5.6 || ^7 -> your php version (8.0; overridden via config.platform, actual: 8.0.6) does not satisfy that requirement.
  Problem 2
    - facebook/facebook-instant-articles-sdk-php v1.10.2 requires php ^5.4 || ^5.6 || ^7 -> your php version (8.0; overridden via config.platform, actual: 8.0.6) does not satisfy that requirement.
    - drupal/fb_instant_articles dev-2.x requires facebook/facebook-instant-articles-sdk-php ^1.10.0 -> satisfiable by facebook/facebook-instant-articles-sdk-php[v1.10.2].
    - Root composer.json requires drupal/fb_instant_articles == dev-2.x -> satisfiable by drupal/fb_instant_articles[dev-2.x].

Unfortunately, the facebook library is not receiving updates, BUT a kind person provided a PR https://github.com/facebook/facebook-instant-articles-sdk-php/pull/372 to support PHP 8

Of course, that PR was not yet merged, but we could use the fork used to create that PR, at least until facebook devs merge it in their repository.

Steps to reproduce

1. Set composer php platform version to 8.0 (as stated in description)
2. Run composer update --lock
3. Note the composer errors.

Proposed resolution

Is not ideal, but we could update this module composer.json to use the provided fork (jeffochoa/facebook-instant-articles-sdk-php) and branch (support-php-8)
at least until those changes get merged into facebook main library.

Remaining tasks

Evaluate if there is better approach to deal with PHP 8 updates.

📌 Task
Status

Needs work

Version

2.0

Component

Miscellaneous

Created by

🇦🇷Argentina anairamzap Buenos Aires

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
Production build 0.71.5 2024