diff --git a/composer.json b/composer.json index 1eb83c14..1b284c75 100644 --- a/composer.json +++ b/composer.json @@ -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" }, diff --git a/src/Migration/Handler/SetValue.php b/src/Migration/Handler/SetValue.php index c1aad874..992b6ff1 100644 --- a/src/Migration/Handler/SetValue.php +++ b/src/Migration/Handler/SetValue.php @@ -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); }