Exception: Deprecated Functionality: trim(): Passing null to parameter ($string) of type string is deprecated in /www/html/vendor/qenta/magento2-qcp/Model/AbstractPayment.php on line 576
If instructions are empty the function below pass null to trim, and this is not allowed anymore.
Maybe there are some more trims where a null value can happend.
We should change this:
public function getInstructions()
{
return trim($this->getConfigData('instructions'));
}
to:
public function getInstructions()
{
return trim($this->getConfigData('instructions') ?? '');
}
Steps to reproduce:
Activate module and payment method, leave instruction field blank, go to cart. Check debug or system log, the error message should appeare.
Prerequisites
Versions
Magento 2 version: 2.4.6-p3 PHP version: 8.2
Issue
Problem description:
Exception: Deprecated Functionality: trim(): Passing null to parameter ($string) of type string is deprecated in /www/html/vendor/qenta/magento2-qcp/Model/AbstractPayment.php on line 576
If instructions are empty the function below pass null to trim, and this is not allowed anymore. Maybe there are some more trims where a null value can happend.
We should change this:
to:
Steps to reproduce:
Activate module and payment method, leave instruction field blank, go to cart. Check debug or system log, the error message should appeare.