facebookarchive / facebook-for-magento2

* Pixel on all pages, which trigger events link, PageView, ViewContent, AddToCart, Initiatecheckout and Purchase.* In the background, Syncs the products from the merchants product catalog to Facebook Catalog.* Stores all the data, like pixel id, catalog id, business maanger id, on to the local database on the instance.
Other
46 stars 36 forks source link

[Bug]: Magento 2.4.4 e PHP 8.1 Suport #110

Open redati opened 2 years ago

redati commented 2 years ago

Contact Details

misaelweb@hotmail.com

What happened?

NOTICE: PHP message: PHP Fatal error: During inheritance of ArrayAccess: Uncaught Exception: Deprecated Functionality: Return type of FacebookAds\Object\ServerSide\AdsPixelSettings::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/AdsPixelSettings.php on line 154 in /var/www/html/vendor/magento/framework/App/ErrorHandler.php:61

Stack trace:

0 /var/www/html/vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/AdsPixelSettings.php(33): Magento\Framework\App\ErrorHandler->handler()

1 /var/www/html/vendor/composer/ClassLoader.php(571): include('/var/www/html/v...')

2 /var/www/html/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()

3 /var/www/html/app/code/Facebook/BusinessExtension/Helper/FBEHelper.php(564): Composer\Autoload\ClassLoader->loadClass()

4 /var/www/html/app/code/Facebook/BusinessExtension/Helper/AAMFieldsExtractorHelper.php(51): Facebook\BusinessExtension\Helper\FBEHelper->getAAMSettings()

5 /var/www/html/app/code/Facebook/BusinessExtension/Block/Pixel/Head.php(52): Facebook\BusinessExtension\Helper\AAMFieldsExtractorHelper->getNormalizedUserData()

6 /var/www/html/app/code/Facebook/BusinessExtension/view/frontend/templates/pixel/head.phtml(20): Facebook\BusinessExtension\Block\Pixel\Head->getPixelInitCode()

7 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/var/www/html/a...')

8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()

9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()

10 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception{closure}()

11 /var/www/html/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()

12 /var/www/html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()

13 /var/www/html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()

14 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()

15 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}()

16 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()

17 /var/www/html/vendor/magento/framework/View/Layout.php(578): Magento\Framework\View\Element\AbstractBlock->toHtml()

18 /var/www/html/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()

19 /var/www/html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()

20 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(511): Magento\Framework\View\Layout->renderElement()

21 /var/www/html/vendor/magento/module-theme/view/frontend/templates/html/container.phtml(7): Magento\Framework\View\Element\AbstractBlock->getChildHtml()

22 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/var/www/html/v...')

23 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()

24 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()

25 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception{closure}()

26 /var/www/html/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()

27 /var/www/html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()

28 /var/www/html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()

29 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()

30 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}()

31 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()

32 /var/www/html/vendor/magento/framework/View/Result/Page.php(253): Magento\Framework\View\Element\AbstractBlock->toHtml()

33 /var/www/html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render()

34 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult()

35 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent()

36 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception{closure}()

37 /var/www/html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(23): Magento\Framework\View\Result\Page\Interceptor->___callPlugins()

38 /var/www/html/vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult()

39 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()

40 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run()

41 {main} in /var/www/html/vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/AdsPixelSettings.php on line 33

172.19.0.16 - 12/Apr/2022:15:55:17 -0300 "GET /index.php" 500

Magento Version

2.4.4

Plugin Version

latest

Relevant log output

No response

Code of Conduct

anvanza commented 2 years ago

Same issue on M2.4.4 and PHP 8.1

Bashev commented 2 years ago

this is not related to this module, this is related for facebook sdk

anvanza commented 2 years ago

this is not related to this module, this is related for facebook sdk

True, but this module is using the facebook SDK. The facebook SDK repository has to perform an update to support PHP8.1 But by doing so they would break backward compatibility.

I suggest to keep this ticket open to track the progress in the SDK library. (as they don't have a issue tracker)

redati commented 2 years ago

this is not related to this module, this is related for facebook sdk

True, but this module is using the facebook SDK. The facebook SDK repository has to perform an update to support PHP8.1 But by doing so they would break backward compatibility.

I suggest to keep this ticket open to track the progress in the SDK library. (as they don't have a issue tracker)

upgrading to 8.1 doesn't make it incompatible with 7. Details are few.

anvanza commented 2 years ago

It does have BC from php 5.6 which is the one listed on their readme. https://github.com/facebook/facebook-php-business-sdk#installation

redati commented 2 years ago

Keeping the current version is more important than maintaining compatibility in terms of security. In my opinion. Anyway, it is still possible to keep the code compatible and up to date.

anvanza commented 2 years ago

I 100% agree with that! All I'm saying is that there are a few hoop FB should jump before this could get resolved. I patched it on my environments btw.

benhath commented 2 years ago

+1 please allow support for PHP 8.1

rangerz commented 2 years ago

Magento 2.4.3 (PHP 7.4) is the end of support is in November 28, 2022 Please raise the priority for Magento 2.4.4+ (PHP 8) support

dankocrama commented 2 years ago

@zlik Same error here please add support for PHP 8+

benhath commented 2 years ago

Any update on this?

mrramanathan31 commented 1 year ago

Getting the same issue in Magento 2.4.5-p1 Enterprise edition. Did you get a chance to resolve this? Any suggestion or solution ???

redati commented 1 year ago

SDK has now suport for php 8.1 https://github.com/facebook/facebook-php-business-sdk/releases/tag/15.0.1

konstanchuk commented 1 year ago

https://github.com/konstanchuk/magento2-facebook-php8 - This solution works for us.

ecrocombe commented 1 year ago

Workaround provided in #131