:::: MENU ::::

Magento Tutorial | Magento Blog | Learn Magento 2

Cookies Consent Popup

That error indicates somewhere in your code passing null to the third parameter when calling a PHP function that is deprecated in PHP 8.1.


Assume you have below code:


return sprintf(
    $path,
    str_replace('methods_', '', $method)
);

The type of the third parameter should be changed to string if it is null. So the fixed code looks like the below:


return sprintf(
    $path,
    str_replace('methods_', '', $method ?? '')
);

The solution for your code:


$fromDate = date("Y-m-d",strtotime(str_replace("/", "-", $helper->getNewYearBallFromDate() ?? '')));
$toDate  = date("Y-m-d",strtotime(str_replace("/", "-", $helper->getNewYearBallToDate() ?? '')));

0 comments:

Post a Comment