From a50f37f18b9d6182202cade8f661d6e5f4e588c9 Mon Sep 17 00:00:00 2001 From: Vincent Boon Date: Wed, 18 Jan 2023 11:54:16 +0100 Subject: [PATCH] Do not save if no changes (#26) * Do not save if no changes * Edit field length --- Job/ImportMetricUnits.php | 4 ++++ etc/db_schema.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Job/ImportMetricUnits.php b/Job/ImportMetricUnits.php index 0da7a29..7c85951 100644 --- a/Job/ImportMetricUnits.php +++ b/Job/ImportMetricUnits.php @@ -69,6 +69,10 @@ public function execute(OutputInterface $output = null): void continue; } + if ($magentoAttribute->getData(self::EAV_ATTRIBUTE_UNIT_FIELD) == $unit) { + continue; + } + $magentoAttribute->setData(self::EAV_ATTRIBUTE_UNIT_FIELD, $unit); $magentoAttribute->save(); diff --git a/etc/db_schema.xml b/etc/db_schema.xml index e46cc1d..e2ec5e7 100644 --- a/etc/db_schema.xml +++ b/etc/db_schema.xml @@ -1,7 +1,7 @@ -