facebook-for-magento2 icon indicating copy to clipboard operation
facebook-for-magento2 copied to clipboard

[Bug]: Magento 2.4.4 e PHP 8.1 Suport

Open redati opened this issue 2 years ago • 15 comments

Contact Details

[email protected]

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

  • [X] I agree to follow this project's Code of Conduct

redati avatar Apr 12 '22 19:04 redati

Same issue on M2.4.4 and PHP 8.1

anvanza avatar Apr 12 '22 19:04 anvanza

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

Bashev avatar Apr 13 '22 09:04 Bashev

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)

anvanza avatar Apr 13 '22 14:04 anvanza

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.

redati avatar Apr 13 '22 16:04 redati

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

anvanza avatar Apr 13 '22 17:04 anvanza

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.

redati avatar Apr 13 '22 17:04 redati

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.

anvanza avatar Apr 13 '22 17:04 anvanza

+1 please allow support for PHP 8.1

benhath avatar May 31 '22 09:05 benhath

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

rangerz avatar Jul 07 '22 21:07 rangerz

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

dankocrama avatar Oct 14 '22 10:10 dankocrama

Any update on this?

benhath avatar Oct 20 '22 18:10 benhath

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

mrramanathan31 avatar Nov 14 '22 07:11 mrramanathan31

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

redati avatar Nov 30 '22 19:11 redati

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

konstanchuk avatar Dec 02 '22 18:12 konstanchuk

Workaround provided in #131

ecrocombe avatar Jan 02 '23 03:01 ecrocombe