From 04e5a42013b40ec69a6900a351d986d525cd7cb3 Mon Sep 17 00:00:00 2001 From: ADDISON <8360474+ADDISON74@users.noreply.github.com> Date: Sat, 6 Jul 2024 13:33:03 +0300 Subject: [PATCH] Strlen callback function This PR is similar to #4083. It replaces the callback function '\strlen' with an arrow function (introduced in PHP 7.4) to avoid the error message bellow starting with PHP >8.1 Deprecated functionality: strlen(): Passing null to parameter #1 --- app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index aabb90c326e..0a4cf80d21e 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -1972,7 +1972,7 @@ protected function _saveStockItem() */ protected function _filterRowData(&$rowData) { - $rowData = array_filter($rowData, '\strlen'); + $rowData = array_filter($rowData, fn ($tmpString) => strlen($tmpString ?? '')); // Exceptions - for sku - put them back in if (!isset($rowData[self::COL_SKU])) { $rowData[self::COL_SKU] = null;