Giter Club home page Giter Club logo

Comments (2)

pratikvs avatar pratikvs commented on August 17, 2024

Hi ecrocombe,

I tried the above given solution with the 2.4.5-p1 EE version and PHP8.1. The solution works fine for the nonl-ogged in user but when the user is logged in it gives the below error. Please check and let us know.

`1 exception(s):
Exception #0 (Exception): Deprecated Functionality: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/magento/vendor/facebook/facebook-for-magento2/Helper/MagentoDataHelper.php on line 481

Exception #0 (Exception): Deprecated Functionality: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/magento/vendor/facebook/facebook-for-magento2/Helper/MagentoDataHelper.php on line 481`

from facebook-for-magento2.

mihaimatei avatar mihaimatei commented on August 17, 2024

@pratikvs , what I've found is that in the dev-main branch, the update from 2 weeks ago just updated the facebook/php-business-sdk 9.0.3 to >=15.0.0, so the sdk is now compatible with php8.1, but they haven't fixed the strtolower bug.
I've opened a PR for this issue: #132

Until it will be merged into, here is a patch that you can use to fix that:
Create a file like patches/composer/facebook-m2-php8fix/facebook-m2-1.4.5-1.4.6-php8.1--1.patch

--- Helper/MagentoDataHelper.php	2022-03-15 15:40:14.000000000 +0000
+++ Helper/MagentoDataHelper.php	2023-01-05 18:16:03.949331672 +0000
@@ -478,7 +478,7 @@
     }

     private function hashValue($string){
-        return hash('sha256', strtolower($string));
+        return hash('sha256', strtolower((string)$string));
     }

     // TODO Remaining user/custom data methods that can be obtained using Magento.

then also add it into composer.json like:

"patches": {
            "facebook/facebook-for-magento2": {
                "facebook-m2-php81--1": "patches/composer/facebook-m2-php8fix/facebook-m2-1.4.5-1.4.6-php8.1--1.patch"
            }
...         

from facebook-for-magento2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.