Created
November 16, 2022 10:44
-
-
Save Ig0r-M-magic42/479d48832c659874b138229f8625ab98 to your computer and use it in GitHub Desktop.
PHP 8.1 compatibility for https://github.com/facebookincubator/facebook-for-magento2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Helper/MagentoDataHelper.php b/Helper/MagentoDataHelper.php | |
index 992edc3..b2d94fa 100644 | |
--- a/Helper/MagentoDataHelper.php | |
+++ b/Helper/MagentoDataHelper.php | |
@@ -478,7 +478,7 @@ class MagentoDataHelper extends AbstractHelper | |
} | |
private function hashValue($string){ | |
- return hash('sha256', strtolower($string)); | |
+ return hash('sha256', strtolower($string ?? '')); | |
} | |
// TODO Remaining user/custom data methods that can be obtained using Magento. | |
diff --git a/Model/Feed/CategoryCollection.php b/Model/Feed/CategoryCollection.php | |
index de32055..0a39a2c 100644 | |
--- a/Model/Feed/CategoryCollection.php | |
+++ b/Model/Feed/CategoryCollection.php | |
@@ -302,7 +302,7 @@ class CategoryCollection | |
$this->fbeHelper->logException($e); | |
} | |
$this->fbeHelper->log("response from fb: ".$response); | |
- $response_obj = json_decode($response, true); | |
+ $response_obj = json_decode($response, true) ?? []; | |
if (array_key_exists('id', $response_obj)) { | |
$set_id = $response_obj['id']; | |
$this->saveFBProductSetID($category, $set_id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment