Nosto/nosto-magento2

Type error thrown when adding product to cart on PHP8.1 env

Closed this issue · 3 comments

Magento 2 version(s) used: 2.4.4
Extension version(s) affected: 6.0.0

Description
When adding product to cart on PHP 8.1 environment type error is thrown.

How to reproduce
Add product to cart.

Magento 2 mode

  • [ X ] Developer
  • [ X ] Production

Full page cache

  • [ X ] Enabled
  • Disabled

Nosto indexer mode

  • Update On Save
  • [ X ] Update By Schedule

Additional context
Here's a stack trace:

TypeError: Nosto\Tagging\CustomerData\HashedTagging::generateVisitorChecksum(): Argument #1 ($string) must be of type string, null given, called in /var/www/html/vendor/nosto/module-nostotagging/CustomerData/CartTagging.php on line 93 and defined in /var/www/html/vendor/nosto/module-nostotagging/CustomerData/HashedTagging.php:55
Stack trace:
#0 /var/www/html/vendor/nosto/module-nostotagging/CustomerData/CartTagging.php(93): Nosto\Tagging\CustomerData\HashedTagging->generateVisitorChecksum()
#1 /var/www/html/vendor/magento/module-customer/CustomerData/SectionPool.php(90): Nosto\Tagging\CustomerData\CartTagging->getSectionData()
#2 /var/www/html/vendor/magento/module-customer/CustomerData/SectionPool.php(60): Magento\Customer\CustomerData\SectionPool->getSectionDataByNames()
#3 /var/www/html/vendor/magento/module-customer/Controller/Section/Load.php(78): Magento\Customer\CustomerData\SectionPool->getSectionsData()
#4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Customer\Controller\Section\Load->execute()
#5 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Customer\Controller\Section\Load\Interceptor->___callParent()
#6 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Customer\Controller\Section\Load\Interceptor->Magento\Framework\Interception{closure}()
#7 /var/www/html/generated/code/Magento/Customer/Controller/Section/Load/Interceptor.php(23): Magento\Customer\Controller\Section\Load\Interceptor->___callPlugins()
#8 /var/www/html/vendor/magento/framework/App/Action/Action.php(111): Magento\Customer\Controller\Section\Load\Interceptor->execute()
#9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch()
#10 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Customer\Controller\Section\Load\Interceptor->___callParent()
#11 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Customer\Controller\Section\Load\Interceptor->Magento\Framework\Interception{closure}()
#12 /var/www/html/generated/code/Magento/Customer/Controller/Section/Load/Interceptor.php(32): Magento\Customer\Controller\Section\Load\Interceptor->___callPlugins()
#13 /var/www/html/vendor/magento/framework/App/FrontController.php(245): Magento\Customer\Controller\Section\Load\Interceptor->dispatch()
#14 /var/www/html/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#15 /var/www/html/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#16 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#18 /var/www/html/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch()
#20 /var/www/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(75): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#21 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch()
#22 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#23 /var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#24 /var/www/html/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#25 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#26 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#27 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#28 {main}

Hi @sweikas it seems like it fails to read Nosto CID cookie. Did you disable Nosto cookies on your store?

@sweikas we added a fix to avoid failing ATC functionality altogether if Nosto cookies are not set. They will be released soon.

@dairbuirabass thanks for the heads up! Looking forward to the new release then.