-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
Preconditions
- 1.9.4.5
- 2.4.7
Steps to reproduce
- Run the data migration step
- See the error
Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /httpdocs/vendor/magento/data-migration-tool/src/Migration/Handler/TruncateSuffix.ph
p on line 93
This is a php version incompatibility that needs to be fixed
Expected result
- No warning is thrown
Actual result
- Warning is thrown
Additional notes
Fixed with
Index: vendor/magento/data-migration-tool/src/Migration/Handler/TruncateSuffix.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vendor/magento/data-migration-tool/src/Migration/Handler/TruncateSuffix.php b/vendor/magento/data-migration-tool/src/Migration/Handler/TruncateSuffix.php
--- a/vendor/magento/data-migration-tool/src/Migration/Handler/TruncateSuffix.php
+++ b/vendor/magento/data-migration-tool/src/Migration/Handler/TruncateSuffix.php (date 1718293775929)
@@ -90,7 +90,7 @@
if (in_array($recordToHandle->getValue('attribute_id'), $attributeIds)) {
$suffix = '~' . preg_quote($this->getSuffix()) . '$~';
$value = $recordToHandle->getValue($this->field);
- $value = preg_replace($suffix, '', $value);
+ $value = preg_replace($suffix, '', (string)$value);
$recordToHandle->setValue($this->field, $value);
}
}
Metadata
Metadata
Assignees
Labels
No labels
