Greetings,
i have a really weird problem.
Magento 2.3.5 gives me a main.CRITICAL error when I close an order, but ONLY in a language other than the default one...
This is what appeards in system.log:
main.CRITICAL: Exception: Deprecated Functionality: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in XXX/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php on line 1044 in /home/204031.cloudwaysapps.com/ntrpxqzjrf/public_html/vendor/magento/framework/App/ErrorHandler.php:62
line 1044 of Abstract.php:
return ($q . str_replace("$q", "$q$q", $value) . $q);
Why is appear only in any different language?
Can someone can help me?
Hello @antonio_ste
This error message suggests that there is a problem with a deprecated function in Magento 2. Specifically, it appears that the str_replace() function is being called with a null value for its third parameter, which is not allowed in the latest version of PHP.
To fix this error, you should update your code to avoid using the str_replace() function with null values for the third parameter. One way to do this is to check if the third parameter is null before calling the function and pass an empty string instead. For example, instead of:
$str = str_replace($search, $replace, null);
You can update your code to:
if ($subject === null) { $subject = ''; } $str = str_replace($search, $replace, $subject);
This will ensure that the str_replace() function is called correctly without passing a null value to its third parameter.
If you find our reply helpful, please give us kudos.
A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
WebDesk Solution Support Team
Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Location: 150 King St. W. Toronto, ON M5H 1J9
but the file: vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php isn't it a magento system file?
I had same problem. But, I can fix it.
When the store view has created, something happened that not created some required table (sequence_creditmemo_{store}, sequence_invoice_{store}, sequence_order_{store}, sequence_shipment_{store}. You also need to create some data in table sales_sequence_meta and sales_sequence_profile.
I hope that you can!
@cgsoratto wrote:I had same problem. But, I can fix it.
When the store view has created, something happened that not created some required table (sequence_creditmemo_{store}, sequence_invoice_{store}, sequence_order_{store}, sequence_shipment_{store}. You also need to create some data in table sales_sequence_meta and sales_sequence_profile.
I hope that you can!
This works for me.
Have to add same tables with store_id
And in below table
sales_sequence_meta
Need to add entries for shipment, creditmemo, invoice and order with store_id and in sequence_table column have to assign the tables created like:
for example check the below image