Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1 Compatibility - TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, null given #104

Open
chapagain opened this issue Nov 30, 2022 · 9 comments

Comments

@chapagain
Copy link

Magento Version: 2.4.5-p1
BV Version: 9.1.5

We are getting the following error in our Magento error log:

[2022-11-29T00:39:16.995302+00:00] report.CRITICAL: TypeError: str_replace(): Argument [# 3] ($subject) must be of type array|string, null given in /app/xxx/vendor/bazaarvoice/bazaarvoice-magento2-ext/Model/Indexer/Eav.php:561 Stack trace: [#0] /app/xxx/vendor/bazaarvoice/bazaarvoice-magento2-ext/Model/Indexer/Eav.php(561): str_replace('/', '-', NULL)

@chapagain chapagain changed the title PHP 8.1 compatibility - TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, null given PHP 8.1 Compatibility - TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, null given Nov 30, 2022
@melavanki
Copy link

Any update on this issue? is this fixed? I am facing same error

@chandu-pinpoint
Copy link

We are getting this error on magento enterprise: 2.4.4 and bazaarvoice: 9.1.5. Any fixes for this please?

@melavanki
Copy link

@chandu-pinpoint, I have created a patch to fix this, please check it may work for you too
image

@nablembv
Copy link

nablembv commented Jul 21, 2023

@melavanki Could you elaborate on how to use this patch?
Should we simply run the command php bin/magento setup:upgrade ?

A client of mine is facing the exact same issue

@melavanki
Copy link

Hey @nablembv, I was out for 2 days so did not see your message.

you need to create a patch file and apply it, its better you check about the Magento patch and how you can use it without altering core files.
bv.patch

let me give you a patch file here, and worry about how to create it.

@nablembv
Copy link

@melavanki all right, thanks for your reply.
So, should the client simply run the following command, at the root of the Git project containing their Magento?
git apply <location-of-your-patch-file>

@melavanki
Copy link

@nablembv, yes correct

@nablembv
Copy link

Hey @melavanki so the client applied the patch, and is now encountering another error, when "running the 'Bazaarvoice product feeds’":

==> ./support_report.log <==
[2023-07-25T12:08:29.067807+00:00] report.CRITICAL: Error: Call to undefined method Bazaarvoice\Connector\Logger\Logger::err() in /app/6og7wjs75i466_stg/vendor/bazaarvoice/bazaarvoice-magento2-ext/Model/Feed/Feed.php:313
Stack trace:
#0 /app/6og7wjs75i466_stg/vendor/bazaarvoice/bazaarvoice-magento2-ext/Model/Feed/ProductFeed.php(219): Bazaarvoice\Connector\Model\Feed\Feed->uploadFeed()
#1 /app/6og7wjs75i466_stg/vendor/bazaarvoice/bazaarvoice-magento2-ext/Model/Feed/ProductFeed.php(140): Bazaarvoice\Connector\Model\Feed\ProductFeed->closeAndUploadFile()
#2 /app/6og7wjs75i466_stg/vendor/bazaarvoice/bazaarvoice-magento2-ext/Model/Feed/Feed.php(161): Bazaarvoice\Connector\Model\Feed\ProductFeed->exportFeedForWebsite()
#3 /app/6og7wjs75i466_stg/vendor/bazaarvoice/bazaarvoice-magento2-ext/Model/Feed/Feed.php(85): Bazaarvoice\Connector\Model\Feed\Feed->exportFeedByWebsite()
#4 /app/6og7wjs75i466_stg/vendor/bazaarvoice/bazaarvoice-magento2-ext/Controller/Adminhtml/Bvfeed/Runproduct.php(46): Bazaarvoice\Connector\Model\Feed\Feed->generateFeed()
#5 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(58): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct->execute()
#6 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(138): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->___callParent()
#7 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(153): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->Magento\Framework\Interception{closure}()
#8 /app/6og7wjs75i466_stg/generated/code/Bazaarvoice/Connector/Controller/Adminhtml/Bvfeed/Runproduct/Interceptor.php(23): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->___callPlugins()
#9 /app/6og7wjs75i466_stg/vendor/magento/framework/App/Action/Action.php(111): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->execute()
#10 /app/6og7wjs75i466_stg/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#11 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#12 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(138): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->___callParent()
#13 /app/6og7wjs75i466_stg/app/code/WeltPixel/Backend/Plugin/Utility.php(76): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->Magento\Framework\Interception{closure}()
#14 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(135): WeltPixel\Backend\Plugin\Utility->aroundDispatch()
#15 /app/6og7wjs75i466_stg/app/code/WeltPixel/Backend/Plugin/Utility.php(76): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->Magento\Framework\Interception{closure}()
#16 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(135): WeltPixel\Backend\Plugin\Utility->aroundDispatch()
#17 /app/6og7wjs75i466_stg/app/code/WeltPixel/Backend/Plugin/Utility.php(76): Bazaarvoice\Connector\Controller\Adminhtml\Bvfeed\Runproduct\Interceptor->Magento\Framework\Interception{closure}()
#18 /app/6og7wjs75i466_stg/vendor/magento/framework/Interception/Interceptor.php(135): WeltPixel\Backend\Plugin\Utility->aroundDispatch()

Would another patch fix the issue?
Thanks!

@melavanki
Copy link

@nablembv, it is a typo error, it must be "error" not "err" on line number 313 Feed.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants