From e4d42d216853d36451cbc280107bf43e83e5c38d Mon Sep 17 00:00:00 2001 From: Michael Mussulis Date: Mon, 28 Aug 2023 09:53:39 -0400 Subject: [PATCH] Minor fixes for PR --- .../imageprocessor/imageitattributeemprocessor.php | 7 +++++-- magmi/plugins/utilities/clearproducts/clearproduct.php | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php b/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php index cdda8164..433e9daa 100644 --- a/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php +++ b/magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php @@ -484,10 +484,13 @@ public function copyImageFile($imgfile, &$item, $extra) $impath = "/$i1/$i2/$bimgfile"; // target directory; - if(!strstr(getcwd(), "pub")) + if(!strstr(getcwd(), "pub")) { $l2d = "pub/media/catalog/product/$i1/$i2"; - else + } + else { $l2d = "media/catalog/product/$i1/$i2"; + } + // test for existence $targetpath = "$l2d/$bimgfile"; diff --git a/magmi/plugins/utilities/clearproducts/clearproduct.php b/magmi/plugins/utilities/clearproducts/clearproduct.php index 428707b5..a04a322a 100644 --- a/magmi/plugins/utilities/clearproducts/clearproduct.php +++ b/magmi/plugins/utilities/clearproducts/clearproduct.php @@ -58,7 +58,6 @@ public function runUtility() } //clean url rewrites for products - //$sql = "DELETE FROM ".$this->tablename("core_url_rewrite")." WHERE product_id IS NOT NULL AND is_system=1"; $sql = "DELETE FROM ".$this->tablename("url_rewrite")." WHERE entity_id IS NOT NULL AND is_autogenerated=1"; $this->delete($sql);