From 8976a642f146f33483d3403b912b77492693f68a Mon Sep 17 00:00:00 2001 From: chuccv Date: Thu, 25 May 2023 14:13:37 +0700 Subject: [PATCH 1/3] [fix] - EmailMarketing: rebase Path is Null. --- Helper/EmailMarketing.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Helper/EmailMarketing.php b/Helper/EmailMarketing.php index 4a03d12..99312ab 100755 --- a/Helper/EmailMarketing.php +++ b/Helper/EmailMarketing.php @@ -24,6 +24,7 @@ use Exception; use IntlDateFormatter; use Magento\Bundle\Helper\Catalog\Product\Configuration as BundleConfiguration; +use Magento\Bundle\Model\Product\Type as Bundle; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Helper\Data as CatalogHelper; use Magento\Catalog\Helper\Product\Configuration as CatalogConfiguration; @@ -34,17 +35,19 @@ use Magento\Catalog\Model\Product\Visibility; use Magento\Catalog\Model\ProductRepository; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; -use Magento\Bundle\Model\Product\Type as Bundle; use Magento\Customer\Model\Address\Config; use Magento\Customer\Model\Attribute; use Magento\Customer\Model\Customer; use Magento\Customer\Model\CustomerFactory; use Magento\Customer\Model\GroupFactory; use Magento\Customer\Model\Metadata\ElementFactory; +use Magento\Directory\Model\CountryFactory; use Magento\Directory\Model\Currency; +use Magento\Directory\Model\Region; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Helper\Context; use Magento\Framework\App\ProductMetadataInterface; +use Magento\Framework\App\ResourceConnection; use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Component\ComponentRegistrarInterface; use Magento\Framework\DataObject; @@ -54,8 +57,8 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem\Directory\ReadFactory; -use Magento\Framework\HTTP\Client\CurlFactory; use Magento\Framework\HTTP\Client\Curl; +use Magento\Framework\HTTP\Client\CurlFactory; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Phrase; use Magento\Framework\Stdlib\DateTime; @@ -68,28 +71,25 @@ use Magento\Quote\Model\Quote\Address; use Magento\Quote\Model\Quote\Item; use Magento\Quote\Model\Quote\ItemFactory; -use Magento\Sales\Model\Order\Item as OrderItem; use Magento\Quote\Model\ResourceModel\Quote as ResourceQuote; use Magento\Reports\Model\ResourceModel\Order\CollectionFactory as ReportOrderCollectionFactory; use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Config as OrderConfig; use Magento\Sales\Model\Order\Creditmemo; -use Magento\Sales\Model\Order\Shipment; use Magento\Sales\Model\Order\Invoice; +use Magento\Sales\Model\Order\Item as OrderItem; +use Magento\Sales\Model\Order\Shipment; use Magento\Sales\Model\ResourceModel\Order\Collection as OrderCollection; use Magento\Shipping\Helper\Data as ShippingHelper; +use Magento\Store\Model\Information; use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreFactory; use Magento\Store\Model\StoreManagerInterface; +use Mageplaza\Smtp\Model\Config\Source\DaysRange; use Mageplaza\Smtp\Model\ResourceModel\AbandonedCart\Grid\Collection; use Psr\Log\LoggerInterface; -use Magento\Sales\Model\Order\Config as OrderConfig; -use Magento\Store\Model\Information; -use Magento\Store\Model\StoreFactory; -use Magento\Directory\Model\CountryFactory; use Zend_Db_Expr; -use Magento\Framework\App\ResourceConnection; -use Mageplaza\Smtp\Model\Config\Source\DaysRange; use Zend_Db_Select_Exception; -use Magento\Directory\Model\Region; /** * Class EmailMarketing @@ -695,7 +695,10 @@ public function getOrderData($object) } if (!$isInvoice) { - $data['order_status_url'] = $this->getOrderViewUrl($object->getStoreId(), $object->getId(), $path); + $urlOrderView = $path + ? $this->getOrderViewUrl($object->getStoreId(), $object->getId(), $path) + : $this->getOrderViewUrl($object->getStoreId(), $object->getId()); + $data['order_status_url'] = $urlOrderView; } if ($isShipment) { From 86d1ff473bc56845d74269f175939460d188679c Mon Sep 17 00:00:00 2001 From: chuccv Date: Thu, 25 May 2023 15:19:45 +0700 Subject: [PATCH 2/3] [fix] - EmailMarketing: rebase Path is Null. --- Helper/EmailMarketing.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Helper/EmailMarketing.php b/Helper/EmailMarketing.php index 99312ab..f14ed8c 100755 --- a/Helper/EmailMarketing.php +++ b/Helper/EmailMarketing.php @@ -695,10 +695,7 @@ public function getOrderData($object) } if (!$isInvoice) { - $urlOrderView = $path - ? $this->getOrderViewUrl($object->getStoreId(), $object->getId(), $path) - : $this->getOrderViewUrl($object->getStoreId(), $object->getId()); - $data['order_status_url'] = $urlOrderView; + $data['order_status_url'] = $this->getOrderViewUrl($object->getStoreId(), $object->getId(), $path); } if ($isShipment) { @@ -820,15 +817,15 @@ public function updateOrderStatusRequest($data) /** * @param int $storeId * @param int $orderId - * @param string $path + * @param string|null $path * * @return string */ - public function getOrderViewUrl($storeId, $orderId, $path = 'sales/order/view') + public function getOrderViewUrl($storeId, $orderId, $path = null) { $this->frontendUrl->setScope($storeId); - return $this->frontendUrl->getUrl($path, ['order_id' => $orderId]); + return $this->frontendUrl->getUrl($path ?? 'sales/order/view', ['order_id' => $orderId]); } /** From cdf2213c224d409c229193c67f68c5ad56aa8e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Huy=20Ph=C3=BAc?= Date: Thu, 25 May 2023 16:06:24 +0700 Subject: [PATCH 3/3] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0fd40b2..3fc0115 100644 --- a/composer.json +++ b/composer.json @@ -2,10 +2,10 @@ "name": "mageplaza/module-smtp", "description": "SMTP Extension for Magento 2 helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers", "require": { - "mageplaza/module-core": "^1.5.1" + "mageplaza/module-core": "^1.5.3" }, "type": "magento2-module", - "version": "4.7.5", + "version": "4.7.6", "license": "proprietary", "authors": [ {