From 5f61bbb5dc54aee34178b665e861842670ac6afa Mon Sep 17 00:00:00 2001 From: Onesh Date: Fri, 26 Aug 2022 09:27:57 +0700 Subject: [PATCH 1/7] Compa 2.4.4 --- Model/ResourceModel/Category/Collection.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/ResourceModel/Category/Collection.php b/Model/ResourceModel/Category/Collection.php index 51d88f31..fb2aba7e 100755 --- a/Model/ResourceModel/Category/Collection.php +++ b/Model/ResourceModel/Category/Collection.php @@ -25,7 +25,6 @@ use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\DB\Select; use Magento\Sales\Model\ResourceModel\Collection\AbstractCollection; -use Magento\Tests\NamingConvention\true\mixed; use Mageplaza\Blog\Api\Data\SearchResult\CategorySearchResultInterface; use Mageplaza\Blog\Model\Category; use Mageplaza\Blog\Model\ResourceModel\Category as CategoryResourceModel; From b79dbe9a90c07992e05025a7ef94f2f742c5f07a Mon Sep 17 00:00:00 2001 From: Onesh Date: Mon, 29 Aug 2022 09:46:05 +0700 Subject: [PATCH 2/7] Compa 2.4.4 --- Controller/Router.php | 2 +- Model/Category.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/Router.php b/Controller/Router.php index aa52896c..39dc1616 100755 --- a/Controller/Router.php +++ b/Controller/Router.php @@ -84,7 +84,7 @@ public function match(RequestInterface $request) $identifier = $this->checkRssIdentifier($identifier); } - $routePath = explode('/', $identifier); + $routePath = explode('/', (string)$identifier); $routeSize = count($routePath); if (!$routeSize || ($routeSize > 3) || (array_shift($routePath) !== $this->helper->getRoute())) { return null; diff --git a/Model/Category.php b/Model/Category.php index 2168f700..d4641d2f 100755 --- a/Model/Category.php +++ b/Model/Category.php @@ -192,7 +192,7 @@ public function getPathIds() { $ids = $this->getData('path_ids'); if ($ids === null) { - $ids = explode('/', $this->getPath()); + $ids = explode('/', (string) $this->getPath()); $this->setData('path_ids', $ids); } From ea39b2b6344fe65d643e9ce7f25b0243f1beea54 Mon Sep 17 00:00:00 2001 From: Onesh Date: Mon, 29 Aug 2022 11:39:57 +0700 Subject: [PATCH 3/7] Compa 2.4.4 --- Helper/Data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Helper/Data.php b/Helper/Data.php index eab49b40..e45e47e7 100755 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -184,7 +184,7 @@ public function isEnabledReview() $groupId = (string)$this->_httpContext->getValue(CustomerContext::CONTEXT_GROUP); if ($this->getConfigGeneral('is_review') - && in_array($groupId, explode(',', $this->getConfigGeneral('review_mode')), true) + && in_array($groupId, explode(',', (string)$this->getConfigGeneral('review_mode')), true) ) { return true; } From aed9fb44ad665bda1b7289dfe1f6d395552c4fb2 Mon Sep 17 00:00:00 2001 From: Onesh Date: Mon, 29 Aug 2022 13:45:32 +0700 Subject: [PATCH 4/7] Compa 2.4.4 --- Controller/Router.php | 8 ++-- Helper/Data.php | 44 +++++++++++----------- view/frontend/templates/product/list.phtml | 12 +++--- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Controller/Router.php b/Controller/Router.php index 39dc1616..d290e960 100755 --- a/Controller/Router.php +++ b/Controller/Router.php @@ -56,7 +56,7 @@ public function __construct( Data $helper ) { $this->actionFactory = $actionFactory; - $this->helper = $helper; + $this->helper = $helper; } /** @@ -70,9 +70,9 @@ public function match(RequestInterface $request) return null; } - $rssAction = "rss.xml"; + $rssAction = "rss.xml"; $identifier = trim($request->getPathInfo(), '/'); - $urlSuffix = $this->helper->getUrlSuffix(); + $urlSuffix = $this->helper->getUrlSuffix(); if ($length = strlen($urlSuffix)) { if (substr($identifier, -$length) === $urlSuffix && !$this->isRss($identifier)) { @@ -166,7 +166,7 @@ public function isRss($identifier) $routePath = explode('/', $identifier); $routePath = array_pop($routePath); $routePath = explode('.', $routePath); - $action = array_shift($routePath); + $action = array_shift($routePath); return $action === 'rss'; } diff --git a/Helper/Data.php b/Helper/Data.php index e45e47e7..f78330ec 100755 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -64,13 +64,13 @@ class Data extends CoreHelper { const CONFIG_MODULE_PATH = 'blog'; - const TYPE_POST = 'post'; - const TYPE_CATEGORY = 'category'; - const TYPE_TAG = 'tag'; - const TYPE_TOPIC = 'topic'; - const TYPE_HISTORY = 'history'; - const TYPE_AUTHOR = 'author'; - const TYPE_MONTHLY = 'month'; + const TYPE_POST = 'post'; + const TYPE_CATEGORY = 'category'; + const TYPE_TAG = 'tag'; + const TYPE_TOPIC = 'topic'; + const TYPE_HISTORY = 'history'; + const TYPE_AUTHOR = 'author'; + const TYPE_MONTHLY = 'month'; /** * @var PostFactory @@ -161,17 +161,17 @@ public function __construct( HttpContext $httpContext, DateTime $dateTime ) { - $this->postFactory = $postFactory; - $this->categoryFactory = $categoryFactory; - $this->tagFactory = $tagFactory; - $this->topicFactory = $topicFactory; - $this->authorFactory = $authorFactory; + $this->postFactory = $postFactory; + $this->categoryFactory = $categoryFactory; + $this->tagFactory = $tagFactory; + $this->topicFactory = $topicFactory; + $this->authorFactory = $authorFactory; $this->postHistoryFactory = $postHistoryFactory; - $this->translitUrl = $translitUrl; - $this->dateTime = $dateTime; - $this->customerSession = $customerSession; - $this->_httpContext = $httpContext; - $this->_productMetadata = $productMetadata; + $this->translitUrl = $translitUrl; + $this->dateTime = $dateTime; + $this->customerSession = $customerSession; + $this->_httpContext = $httpContext; + $this->_productMetadata = $productMetadata; parent::__construct($context, $objectManager, $storeManager); } @@ -184,7 +184,7 @@ public function isEnabledReview() $groupId = (string)$this->_httpContext->getValue(CustomerContext::CONTEXT_GROUP); if ($this->getConfigGeneral('is_review') - && in_array($groupId, explode(',', (string)$this->getConfigGeneral('review_mode')), true) + && in_array($groupId, explode(',', (string) $this->getConfigGeneral('review_mode')), true) ) { return true; } @@ -564,9 +564,9 @@ public function getBlogUrl($urlKey = null, $type = null, $store = null) } $urlKey = ($type ? $type . '/' : '') . $urlKey; - $url = $this->getUrl($this->getRoute($store) . '/' . $urlKey); - $url = explode('?', $url); - $url = $url[0]; + $url = $this->getUrl($this->getRoute($store) . '/' . $urlKey); + $url = explode('?', $url); + $url = $url[0]; return rtrim($url, '/') . $this->getUrlSuffix($store); } @@ -658,7 +658,7 @@ public function checkUrlKey($resource, $object, $urlKey) } $adapter = $resource->getConnection(); - $select = $adapter->select() + $select = $adapter->select() ->from($resource->getMainTable(), '*') ->where('url_key = :url_key'); diff --git a/view/frontend/templates/product/list.phtml b/view/frontend/templates/product/list.phtml index dbafeffe..5c4a5a7e 100644 --- a/view/frontend/templates/product/list.phtml +++ b/view/frontend/templates/product/list.phtml @@ -89,10 +89,10 @@ $_helper = $block->getHelper(); getProductDetailsHtml($_product) ?>
escapeHtmlAttr($position) : '' ?>>
escapeHtmlAttr($position) : '' ?>> isSaleable()) : ?> getAddToCartPostParams($_product); ?> @@ -123,7 +123,7 @@ $_helper = $block->getHelper();
escapeHtmlAttr($position) : '' ?>> getChildBlock('addto')) : ?> setProduct($_product)->getChildHtml() ?> @@ -183,10 +183,10 @@ $_helper = $block->getHelper(); getProductDetailsHtml($_product) ?>
escapeHtmlAttr($position) : '' ?>>
escapeHtmlAttr($position) : '' ?>> isSaleable()) : ?> getAddToCartPostParams($_product); ?> @@ -218,7 +218,7 @@ $_helper = $block->getHelper();
escapeHtmlAttr($position) : '' ?>> getChildBlock('addto')) : ?> setProduct($_product)->getChildHtml() ?> From b05a6d25202b02fa913bba1bd44972faa461371c Mon Sep 17 00:00:00 2001 From: Onesh Date: Mon, 29 Aug 2022 14:01:56 +0700 Subject: [PATCH 5/7] Compa 2.4.4 --- Block/Frontend.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Block/Frontend.php b/Block/Frontend.php index 215dee2e..b577c5f9 100755 --- a/Block/Frontend.php +++ b/Block/Frontend.php @@ -254,9 +254,11 @@ public function getPageFilter($content) public function getImageUrl($image, $type = Image::TEMPLATE_MEDIA_TYPE_POST) { $imageHelper = $this->helperData->getImageHelper(); - $imageFile = $imageHelper->getMediaPath($image, $type); + if ($image) { + $imageFile = $imageHelper->getMediaPath($image, $type); + } - return $this->helperData->getImageHelper()->getMediaUrl($imageFile); + return $image ? $imageFile : ''; } /** From e79e5c8b32c77d4886f75bdf4a4195734db427c6 Mon Sep 17 00:00:00 2001 From: Onesh Date: Mon, 29 Aug 2022 16:45:33 +0700 Subject: [PATCH 6/7] Compa 2.4.4 --- Block/Frontend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Block/Frontend.php b/Block/Frontend.php index b577c5f9..d88b50e9 100755 --- a/Block/Frontend.php +++ b/Block/Frontend.php @@ -258,7 +258,7 @@ public function getImageUrl($image, $type = Image::TEMPLATE_MEDIA_TYPE_POST) $imageFile = $imageHelper->getMediaPath($image, $type); } - return $image ? $imageFile : ''; + return $image ? $this->helperData->getImageHelper()->getMediaUrl($imageFile) : ''; } /** From 1996968bef985b058690f452efca9dc26c8bf375 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 12 Sep 2022 16:41:17 +0700 Subject: [PATCH 7/7] Clean code --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ad426ef5..70a625ba 100755 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "mageplaza/module-core": "^1.4.12" }, "type": "magento2-module", - "version": "4.1.4", + "version": "4.1.5", "license": "proprietary", "keywords": [ "magento 2",