Skip to content

Commit

Permalink
ACP2E-1531: Data Migration Tool 2.4.5 with PHP 8.1 compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-v-rad committed Jan 13, 2023
1 parent ab64f46 commit 148cd11
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Migration Tool",
"version": "2.4.5",
"require": {
"symfony/console": "~4.4.0",
"symfony/console": "^5.4",
"magento/framework": "*",
"monolog/monolog": "^2.3"
},
Expand Down
25 changes: 14 additions & 11 deletions src/Migration/Handler/SetValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@ public function handle(Record $recordToHandle, Record $oppositeRecord)
{
$this->validate($recordToHandle);
$valueStored = $recordToHandle->getValue($this->field);
$operator = substr($this->value, 0, 1);
$value = substr($this->value, 1);
switch ($operator) {
case '+':
$value = $valueStored + $value;
break;
case '-';
$value = $valueStored - $value;
break;
default:
$value = $this->value;
$value = $this->value;
if (is_string($value)) {
$operator = substr($value, 0, 1);
$value = substr($value, 1);
switch ($operator) {
case '+':
$value = $valueStored + $value;
break;
case '-';
$value = $valueStored - $value;
break;
default:
$value = $this->value;
}
}
$recordToHandle->setValue($this->field, $value);
}
Expand Down

0 comments on commit 148cd11

Please sign in to comment.