From c308795d3c520d1785d8db88461692283cbe8eee Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Sat, 19 May 2018 11:23:56 +0530 Subject: [PATCH 1/6] #14063 - Wrong invoice prefix in multistore setup due to default store id --- .../Magento/Sales/Model/ResourceModel/EntityAbstract.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/ResourceModel/EntityAbstract.php b/app/code/Magento/Sales/Model/ResourceModel/EntityAbstract.php index 8a8ee5e9c799f..2152ff7c84556 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/EntityAbstract.php +++ b/app/code/Magento/Sales/Model/ResourceModel/EntityAbstract.php @@ -121,10 +121,15 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) { /** @var \Magento\Sales\Model\AbstractModel $object */ if ($object instanceof EntityInterface && $object->getIncrementId() == null) { + $store = $object->getStore(); + $storeId = $store->getId(); + if ($storeId === null) { + $storeId = $store->getGroup()->getDefaultStoreId(); + } $object->setIncrementId( $this->sequenceManager->getSequence( $object->getEntityType(), - $object->getStore()->getGroup()->getDefaultStoreId() + $storeId )->getNextValue() ); } From b04093c17be2979d2148d72d3e056710954f958c Mon Sep 17 00:00:00 2001 From: Elias Kotlyar Date: Tue, 29 May 2018 12:19:46 +0200 Subject: [PATCH 2/6] Fixxes #15565 --- app/code/Magento/Store/Model/PathConfig.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Store/Model/PathConfig.php b/app/code/Magento/Store/Model/PathConfig.php index 0d80d98c32821..aacc59d973767 100644 --- a/app/code/Magento/Store/Model/PathConfig.php +++ b/app/code/Magento/Store/Model/PathConfig.php @@ -76,6 +76,8 @@ public function shouldBeSecure($path) */ public function getDefaultPath() { - return $this->scopeConfig->getValue('web/default/front', ScopeInterface::SCOPE_STORE); + $store = $this->storeManager->getStore(); + $value =$this->scopeConfig->getValue('web/default/front', ScopeInterface::SCOPE_STORE,$store); + return $value; } } From 486c5d4e65d56ece58f0ed28ec064b9fbae214d8 Mon Sep 17 00:00:00 2001 From: Vishal Gelani Date: Tue, 29 May 2018 19:02:13 +0530 Subject: [PATCH 3/6] Fixed coding standard error --- app/code/Magento/Store/Model/PathConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Store/Model/PathConfig.php b/app/code/Magento/Store/Model/PathConfig.php index aacc59d973767..f55388bb4695e 100644 --- a/app/code/Magento/Store/Model/PathConfig.php +++ b/app/code/Magento/Store/Model/PathConfig.php @@ -77,7 +77,7 @@ public function shouldBeSecure($path) public function getDefaultPath() { $store = $this->storeManager->getStore(); - $value =$this->scopeConfig->getValue('web/default/front', ScopeInterface::SCOPE_STORE,$store); + $value = $this->scopeConfig->getValue('web/default/front', ScopeInterface::SCOPE_STORE, $store); return $value; } } From e4b77ebc50b163fc43ceea2b9691434855afb765 Mon Sep 17 00:00:00 2001 From: vgelani Date: Sat, 19 May 2018 13:23:33 +0530 Subject: [PATCH 4/6] Refactor validate code in Tax module --- .../adminhtml/templates/class/page/edit.phtml | 7 +++++++ .../Tax/view/adminhtml/web/js/page/validate.js | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js diff --git a/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml b/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml index 32f692c32fccf..a6a6d31453c37 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml @@ -18,3 +18,10 @@ require(['jquery', "mage/mage"], function(jQuery){ }); + diff --git a/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js b/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js new file mode 100644 index 0000000000000..797dfdfdb9dfe --- /dev/null +++ b/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js @@ -0,0 +1,15 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'mage/mage' +], function(jQuery){ + 'use strict'; + + return function (data, element) { + jQuery(element).mage('form').mage('validation'); + } +}); \ No newline at end of file From dcc10e9d99ecb086861da1bf7aa988c40ab9fd94 Mon Sep 17 00:00:00 2001 From: Vishal Gelani Date: Sat, 19 May 2018 20:49:01 +0530 Subject: [PATCH 5/6] Fixed semicolon issue --- app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js b/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js index 797dfdfdb9dfe..50afc80689477 100644 --- a/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js +++ b/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js @@ -11,5 +11,5 @@ define([ return function (data, element) { jQuery(element).mage('form').mage('validation'); - } -}); \ No newline at end of file + }; +}); From 4d67269ebef266592e0fd1a3442cb4fbe116ce9e Mon Sep 17 00:00:00 2001 From: Vishal Gelani Date: Sun, 20 May 2018 20:15:18 +0530 Subject: [PATCH 6/6] Fixed coding standard issue --- app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js b/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js index 50afc80689477..a49f199ba56b6 100644 --- a/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js +++ b/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js @@ -6,7 +6,7 @@ define([ 'jquery', 'mage/mage' -], function(jQuery){ +], function (jQuery) { 'use strict'; return function (data, element) {