Skip to content

Commit c64f6d3

Browse files
author
Michail Slabko
committed
MAGETWO-45453: Product API does not work properly for non-default store code
- fix SOAP issue with "all" store code
1 parent 55063d7 commit c64f6d3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/code/Magento/Webapi/Controller/PathProcessor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ public function process($pathInfo)
5353
if (isset($stores[$storeCode])) {
5454
$this->storeManager->setCurrentStore($storeCode);
5555
$path = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
56-
} else if ($storeCode === self::ALL_STORE_CODE || $storeCode === \Magento\Store\Model\Store::ADMIN_CODE) {
57-
//TODO: eliminate "admin" check after MAGETWO-45544
56+
} else if ($storeCode === self::ALL_STORE_CODE) {
5857
$this->storeManager->setCurrentStore(\Magento\Store\Model\Store::ADMIN_CODE);
5958
$path = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
6059
} else {

app/code/Magento/Webapi/Model/Soap/Server.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,12 @@ public function generateUri($isWsdl = false)
148148
*/
149149
public function getEndpointUri()
150150
{
151+
$storeCode = $this->_storeManager->getStore()->getCode() === \Magento\Store\Model\Store::ADMIN_CODE
152+
? \Magento\Webapi\Controller\PathProcessor::ALL_STORE_CODE
153+
: $this->_storeManager->getStore()->getCode();
151154
return $this->_storeManager->getStore()->getBaseUrl()
152155
. $this->_areaList->getFrontName($this->_configScope->getCurrentScope())
153-
. '/' . $this->_storeManager->getStore()->getCode();
156+
. '/' . $storeCode;
154157
}
155158

156159
/**

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter/Soap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ public function generateWsdlUrl($services, $storeCode = null)
127127
->get('Magento\Store\Model\StoreManagerInterface')
128128
->getStore()
129129
->getCode();
130-
} elseif ($storeCode === \Magento\Webapi\Controller\PathProcessor::ALL_STORE_CODE) {
131-
$storeCode = \Magento\Store\Model\Store::ADMIN_CODE;
132130
}
133131

134132
/** TESTS_BASE_URL is initialized in PHPUnit configuration */

0 commit comments

Comments
 (0)