diff --git a/app/code/Magento/Catalog/i18n/en_US.csv b/app/code/Magento/Catalog/i18n/en_US.csv
index de9f5e1975870fe039dc605efbef24ec480d0ca4..a316bac5d35848fe73a608706cfd7f437599bc7a 100644
--- a/app/code/Magento/Catalog/i18n/en_US.csv
+++ b/app/code/Magento/Catalog/i18n/en_US.csv
@@ -615,7 +615,7 @@ Submit,Submit
 "We don't recognize or support this file extension type.","We don't recognize or support this file extension type."
 "Configure Product","Configure Product"
 OK,OK
-"This value does not follow the specified format (for example, 200X300).","This value does not follow the specified format (for example, 200X300)."
+"This value does not follow the specified format (for example, 200x300).","This value does not follow the specified format (for example, 200x300)."
 "Select type of option.","Select type of option."
 "Please add rows to option.","Please add rows to option."
 "Please select items.","Please select items."
diff --git a/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js b/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js
index 3ebd4bdf9c804450d9b4baabffcbfe7aa9b1b9b0..11a1a65cbab4785cca4a3adfd93486d66527a2d4 100644
--- a/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js
+++ b/app/code/Magento/Catalog/view/adminhtml/web/component/image-size-field.js
@@ -26,7 +26,7 @@ define([
 
             return !!(m &&  m[1] > 0 && m[2] > 0);
         },
-        $.mage.__('This value does not follow the specified format (for example, 200X300).')
+        $.mage.__('This value does not follow the specified format (for example, 200x300).')
     );
 
     return Abstract.extend({
diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php
index e6345af40f37ad9a87c97e5bcfbd7226867ea7c9..fbaa4e60c29cc93da23bca1c9e303daac5ad025f 100644
--- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php
+++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php
@@ -3,6 +3,7 @@
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
+
 namespace Magento\ConfigurableProduct\Model\Product\Type;
 
 use Magento\Catalog\Api\Data\ProductAttributeInterface;
@@ -682,7 +683,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType
                 ->setProductId($product->getData($metadata->getLinkField()))
                 ->save();
         }
-        /** @var $configurableAttributesCollection \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection  */
+        /** @var $configurableAttributesCollection \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection */
         $configurableAttributesCollection = $this->_attributeCollectionFactory->create();
         $configurableAttributesCollection->setProductFilter($product);
         $configurableAttributesCollection->addFieldToFilter(
@@ -1397,7 +1398,16 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType
             ->addFilterByRequiredOptions()
             ->setStoreId($product->getStoreId());
 
-        $requiredAttributes = ['name', 'price', 'weight', 'image', 'thumbnail', 'status', 'media_gallery'];
+        $requiredAttributes = [
+            'name',
+            'price',
+            'weight',
+            'image',
+            'thumbnail',
+            'status',
+            'visibility',
+            'media_gallery'
+        ];
         foreach ($requiredAttributes as $attributeCode) {
             $collection->addAttributeToSelect($attributeCode);
         }
diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/ConfigurableTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/ConfigurableTest.php
index 6ffdede34d04c77174a29fbe90b6c9a00deb478d..ea136dd037bafea26be7ce14f39f89deb1960572 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/ConfigurableTest.php
+++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/ConfigurableTest.php
@@ -197,11 +197,6 @@ class ConfigurableTest extends \PHPUnit\Framework\TestCase
             ->disableOriginalConstructor()
             ->getMock();
 
-        $this->productFactory = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductInterfaceFactory::class)
-            ->setMethods(['create'])
-            ->disableOriginalConstructor()
-            ->getMock();
-
         $this->salableProcessor = $this->createMock(SalableProcessor::class);
 
         $this->model = $this->objectHelper->getObject(
diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php
index ba646549f6919a5f933831cdb33b05930988a2d8..894dd5931a63c6be9e8590cc422aa2d0de92b666 100644
--- a/app/code/Magento/Customer/Model/AccountManagement.php
+++ b/app/code/Magento/Customer/Model/AccountManagement.php
@@ -817,6 +817,8 @@ class AccountManagement implements AccountManagementInterface
         } catch (MailException $e) {
             // If we are not able to send a new account email, this should be ignored
             $this->logger->critical($e);
+        } catch (\UnexpectedValueException $e) {
+            $this->logger->error($e);
         }
     }
 
diff --git a/app/code/Magento/Customer/Model/AttributeChecker.php b/app/code/Magento/Customer/Model/AttributeChecker.php
index 6cc27697ccff7cc5baf0cc8141e9001b2b2f908d..dcdd47691386efbd19186fb7930d4d7db0922e9f 100644
--- a/app/code/Magento/Customer/Model/AttributeChecker.php
+++ b/app/code/Magento/Customer/Model/AttributeChecker.php
@@ -8,7 +8,6 @@ namespace Magento\Customer\Model;
 use Magento\Customer\Api\AddressMetadataInterface;
 use Magento\Customer\Api\AddressMetadataManagementInterface;
 use Magento\Customer\Model\Metadata\AttributeResolver;
-use Magento\Framework\App\Helper\Context;
 
 /**
  * Customer attribute checker.
diff --git a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php
index 2a6b9fe6fd4ea44edfed07f85aaaf36d69357eca..676e9c98a2008eebe06aca66f14602573f88c036 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php
@@ -1721,4 +1721,102 @@ class AccountManagementTest extends \PHPUnit\Framework\TestCase
 
         return $dateTime;
     }
+
+    public function testCreateAccountUnexpectedValueException()
+    {
+        $websiteId = 1;
+        $storeId = null;
+        $defaultStoreId = 1;
+        $customerId = 1;
+        $customerEmail = 'email@email.com';
+        $newLinkToken = '2jh43j5h2345jh23lh452h345hfuzasd96ofu';
+        $exception = new \UnexpectedValueException('Template file was not found');
+
+        $datetime = $this->prepareDateTimeFactory();
+
+        $address = $this->createMock(\Magento\Customer\Api\Data\AddressInterface::class);
+        $address->expects($this->once())
+            ->method('setCustomerId')
+            ->with($customerId);
+        $store = $this->createMock(\Magento\Store\Model\Store::class);
+        $store->expects($this->once())
+            ->method('getId')
+            ->willReturn($defaultStoreId);
+        $website = $this->createMock(\Magento\Store\Model\Website::class);
+        $website->expects($this->atLeastOnce())
+            ->method('getStoreIds')
+            ->willReturn([1, 2, 3]);
+        $website->expects($this->once())
+            ->method('getDefaultStore')
+            ->willReturn($store);
+        $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class);
+        $customer->expects($this->atLeastOnce())
+            ->method('getId')
+            ->willReturn($customerId);
+        $customer->expects($this->atLeastOnce())
+            ->method('getEmail')
+            ->willReturn($customerEmail);
+        $customer->expects($this->atLeastOnce())
+            ->method('getWebsiteId')
+            ->willReturn($websiteId);
+        $customer->expects($this->atLeastOnce())
+            ->method('getStoreId')
+            ->willReturn($storeId);
+        $customer->expects($this->once())
+            ->method('setStoreId')
+            ->with($defaultStoreId);
+        $customer->expects($this->once())
+            ->method('getAddresses')
+            ->willReturn([$address]);
+        $customer->expects($this->once())
+            ->method('setAddresses')
+            ->with(null);
+        $this->customerRepository->expects($this->once())
+            ->method('get')
+            ->with($customerEmail)
+            ->willReturn($customer);
+        $this->share->expects($this->once())
+            ->method('isWebsiteScope')
+            ->willReturn(true);
+        $this->storeManager->expects($this->atLeastOnce())
+            ->method('getWebsite')
+            ->with($websiteId)
+            ->willReturn($website);
+        $this->customerRepository->expects($this->atLeastOnce())
+            ->method('save')
+            ->willReturn($customer);
+        $this->addressRepository->expects($this->atLeastOnce())
+            ->method('save')
+            ->with($address);
+        $this->customerRepository->expects($this->once())
+            ->method('getById')
+            ->with($customerId)
+            ->willReturn($customer);
+        $this->random->expects($this->once())
+            ->method('getUniqueHash')
+            ->willReturn($newLinkToken);
+        $customerSecure = $this->createPartialMock(
+            \Magento\Customer\Model\Data\CustomerSecure::class,
+            ['setRpToken', 'setRpTokenCreatedAt', 'getPasswordHash']
+        );
+        $customerSecure->expects($this->any())
+            ->method('setRpToken')
+            ->with($newLinkToken);
+        $customerSecure->expects($this->any())
+            ->method('setRpTokenCreatedAt')
+            ->with($datetime)
+            ->willReturnSelf();
+        $customerSecure->expects($this->any())
+            ->method('getPasswordHash')
+            ->willReturn(null);
+        $this->customerRegistry->expects($this->atLeastOnce())
+            ->method('retrieveSecureData')
+            ->willReturn($customerSecure);
+        $this->emailNotificationMock->expects($this->once())
+            ->method('newAccount')
+            ->willThrowException($exception);
+        $this->logger->expects($this->once())->method('error')->with($exception);
+
+        $this->accountManagement->createAccount($customer);
+    }
 }
diff --git a/app/code/Magento/Email/Model/Template/Config.php b/app/code/Magento/Email/Model/Template/Config.php
index bdd9054e7969b9f73b99244f5883499c7246eeaa..8a7e7172a8e6ec6e07b031e97a8cb5a1225ceb19 100644
--- a/app/code/Magento/Email/Model/Template/Config.php
+++ b/app/code/Magento/Email/Model/Template/Config.php
@@ -205,8 +205,9 @@ class Config implements \Magento\Framework\Mail\Template\ConfigInterface
         $designParams['module'] = $module;
 
         $file = $this->_getInfo($templateId, 'file');
+        $filename = $this->getFilename($file, $designParams, $module);
 
-        return $this->viewFileSystem->getEmailTemplateFileName($file, $designParams, $module);
+        return $filename;
     }
 
     /**
@@ -230,4 +231,24 @@ class Config implements \Magento\Framework\Mail\Template\ConfigInterface
         }
         return $data[$templateId][$fieldName];
     }
+
+    /**
+     * @param string $file
+     * @param array $designParams
+     * @param string $module
+     *
+     * @return string
+     *
+     * @throws \UnexpectedValueException
+     */
+    private function getFilename($file, array $designParams, $module)
+    {
+        $filename = $this->viewFileSystem->getEmailTemplateFileName($file, $designParams, $module);
+
+        if ($filename === false) {
+            throw new \UnexpectedValueException("Template file '{$file}' is not found.");
+        }
+
+        return $filename;
+    }
 }
diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php
index 47c3ac1e7e45075a7d8ab6c9ca33fb13193dd355..6a565ca08eb9b4909e18c695d701d01197ee3615 100644
--- a/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php
+++ b/app/code/Magento/Email/Test/Unit/Model/Template/ConfigTest.php
@@ -272,6 +272,19 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
         $this->assertEquals('_files/Fixture/ModuleOne/view/frontend/email/one.html', $actualResult);
     }
 
+    /**
+     * @expectedException \UnexpectedValueException
+     * @expectedExceptionMessage Template file 'one.html' is not found
+     */
+    public function testGetTemplateFilenameWrongFileName()
+    {
+        $this->viewFileSystem->expects($this->once())->method('getEmailTemplateFileName')
+            ->with('one.html', $this->designParams, 'Fixture_ModuleOne')
+            ->willReturn(false);
+
+        $this->model->getTemplateFilename('template_one', $this->designParams);
+    }
+
     /**
      * @param string $getterMethod
      * @param $argument
diff --git a/app/code/Magento/NewRelicReporting/Console/Command/DeployMarker.php b/app/code/Magento/NewRelicReporting/Console/Command/DeployMarker.php
new file mode 100644
index 0000000000000000000000000000000000000000..795028cffd18d0ac82f7aeec91959b03dfef0364
--- /dev/null
+++ b/app/code/Magento/NewRelicReporting/Console/Command/DeployMarker.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\NewRelicReporting\Console\Command;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Magento\NewRelicReporting\Model\Apm\DeploymentsFactory;
+use Magento\NewRelicReporting\Model\ServiceShellUser;
+
+class DeployMarker extends Command
+{
+    /**
+     * @var DeploymentsFactory
+     */
+    private $deploymentsFactory;
+
+    /**
+     * @var ServiceShellUser
+     */
+    private $serviceShellUser;
+
+    /**
+     * Initialize dependencies.
+     *
+     * @param DeploymentsFactory $deploymentsFactory
+     * @param ServiceShellUser $serviceShellUser
+     * @param null $name
+     */
+    public function __construct(
+        DeploymentsFactory $deploymentsFactory,
+        ServiceShellUser $serviceShellUser,
+        $name = null
+    ) {
+        $this->deploymentsFactory = $deploymentsFactory;
+        $this->serviceShellUser = $serviceShellUser;
+        parent::__construct($name);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function configure()
+    {
+        $this->setName("newrelic:create:deploy-marker");
+        $this->setDescription("Check the deploy queue for entries and create an appropriate deploy marker.")
+             ->addArgument(
+                 'message',
+                 InputArgument::REQUIRED,
+                 'Deploy Message?'
+             )
+             ->addArgument(
+                 'changelog',
+                 InputArgument::REQUIRED,
+                 'Change Log?'
+             )
+             ->addArgument(
+                 'user',
+                 InputArgument::OPTIONAL,
+                 'Deployment User'
+             );
+        parent::configure();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        $this->deploymentsFactory->create()->setDeployment(
+            $input->getArgument('message'),
+            $input->getArgument('changelog'),
+            $this->serviceShellUser->get($input->getArgument('user'))
+        );
+        $output->writeln('<info>NewRelic deployment information sent</info>');
+    }
+}
diff --git a/app/code/Magento/NewRelicReporting/Model/Cron/ReportNewRelicCron.php b/app/code/Magento/NewRelicReporting/Model/Cron/ReportNewRelicCron.php
index a4a7d30b44f5bdf6c8198e4106b208d347d3c1f7..6b2bd50dc456b2523cf773b5fbc407b97055de7e 100644
--- a/app/code/Magento/NewRelicReporting/Model/Cron/ReportNewRelicCron.php
+++ b/app/code/Magento/NewRelicReporting/Model/Cron/ReportNewRelicCron.php
@@ -175,7 +175,6 @@ class ReportNewRelicCron
     public function report()
     {
         if ($this->config->isNewRelicEnabled()) {
-            $this->reportModules();
             $this->reportCounts();
         }
 
diff --git a/app/code/Magento/NewRelicReporting/Model/ServiceShellUser.php b/app/code/Magento/NewRelicReporting/Model/ServiceShellUser.php
new file mode 100644
index 0000000000000000000000000000000000000000..c038be4fb2a760993034d3b0da5bb4a6b960764b
--- /dev/null
+++ b/app/code/Magento/NewRelicReporting/Model/ServiceShellUser.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\NewRelicReporting\Model;
+
+class ServiceShellUser
+{
+    /**
+     * Default user name;
+     */
+    const DEFAULT_USER = 'cron';
+
+    /**
+     * Get use name.
+     *
+     * @param bool $userFromArgument
+     * @return string
+     */
+    public function get($userFromArgument = false)
+    {
+        if ($userFromArgument) {
+            return $userFromArgument;
+        }
+
+        $user = `echo \$USER`;
+        if ($user) {
+            return $user;
+        }
+
+        return self::DEFAULT_USER;
+    }
+}
diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php
index 70fdcd0b6191cd5881a54f8a8f9e983a5771a386..400bcefa9828b060c79c16541b150b999869393a 100644
--- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php
+++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php
@@ -144,24 +144,10 @@ class ReportNewRelicCronTest extends \PHPUnit\Framework\TestCase
      */
     public function testReportNewRelicCron()
     {
-        $testModuleData = [
-            'changes' => [
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'enabled'],
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'disabled'],
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'installed'],
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'uninstalled'],
-            ],
-            'enabled' => 1,
-            'disabled' => 1,
-            'installed' => 1,
-        ];
 
         $this->config->expects($this->once())
             ->method('isNewRelicEnabled')
             ->willReturn(true);
-        $this->collect->expects($this->once())
-            ->method('getModuleData')
-            ->willReturn($testModuleData);
         $this->counter->expects($this->once())
             ->method('getAllProductsCount');
         $this->counter->expects($this->once())
@@ -198,24 +184,10 @@ class ReportNewRelicCronTest extends \PHPUnit\Framework\TestCase
      */
     public function testReportNewRelicCronRequestFailed()
     {
-        $testModuleData = [
-            'changes' => [
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'enabled'],
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'disabled'],
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'installed'],
-                ['name' => 'name', 'setup_version' => '2.0.0', 'type' => 'uninstalled'],
-            ],
-            'enabled' => 1,
-            'disabled' => 1,
-            'installed' => 1,
-        ];
 
         $this->config->expects($this->once())
             ->method('isNewRelicEnabled')
             ->willReturn(true);
-        $this->collect->expects($this->once())
-            ->method('getModuleData')
-            ->willReturn($testModuleData);
         $this->counter->expects($this->once())
             ->method('getAllProductsCount');
         $this->counter->expects($this->once())
diff --git a/app/code/Magento/NewRelicReporting/etc/di.xml b/app/code/Magento/NewRelicReporting/etc/di.xml
index cba92f91cd4bbddb9a5de0201e7ba3c4d71ccf5a..2dccc45c1129b7aaca71f7b6f63f29feeb95f9ca 100644
--- a/app/code/Magento/NewRelicReporting/etc/di.xml
+++ b/app/code/Magento/NewRelicReporting/etc/di.xml
@@ -30,4 +30,11 @@
     <type name="Magento\Framework\App\Http">
         <plugin name="framework-http-newrelic" type="Magento\NewRelicReporting\Plugin\HttpPlugin"/>
     </type>
+    <type name="Magento\Framework\Console\CommandListInterface">
+        <arguments>
+            <argument name="commands" xsi:type="array">
+                <item name="newrelicreporting_deploy_marker" xsi:type="object">Magento\NewRelicReporting\Console\Command\DeployMarker</item>
+            </argument>
+        </arguments>
+    </type>
 </config>
diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js
index c0036b71ac86ac7550b0faaa6d59f0382141cb2e..3104fdc6190dc6bf80de2e132d703246d2923fb5 100644
--- a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js
+++ b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js
@@ -207,7 +207,7 @@ define([
                 if (options.dataMergeStrategy === 'prepend') {
                     this.options.videoData = [].concat(
                         this.options.optionsVideoData[options.selectedOption],
-                        this.options.videoData
+                        this.defaultVideoData
                     );
                 } else {
                     this.options.videoData = this.options.optionsVideoData[options.selectedOption];
diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php
index f6a5f029eafca2818897c81d75535596598c241d..cad8023bd2794d7f17cab7a82fd3005e3fb16edd 100644
--- a/app/code/Magento/Sitemap/Model/Sitemap.php
+++ b/app/code/Magento/Sitemap/Model/Sitemap.php
@@ -273,6 +273,7 @@ class Sitemap extends \Magento\Framework\Model\AbstractModel implements \Magento
         /** @var $helper \Magento\Sitemap\Helper\Data */
         $helper = $this->_sitemapData;
         $storeId = $this->getStoreId();
+        $this->_storeManager->setCurrentStore($storeId);
 
         $this->addSitemapItem(new DataObject(
             [
diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php
index 83210c5789776a845607c5343e12e85bb31d6d5d..4f55653fad311fef40352cc65b4cb9a94b38f8fc 100644
--- a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php
+++ b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php
@@ -253,6 +253,8 @@ class SitemapTest extends \PHPUnit\Framework\TestCase
             $expectedWrites,
             null
         );
+        $this->storeManagerMock->expects($this->once())->method('setCurrentStore')->with(1);
+
         $model->generateXml();
 
         $this->assertCount(count($expectedFile), $actualData, 'Number of generated files is incorrect');
@@ -360,6 +362,8 @@ class SitemapTest extends \PHPUnit\Framework\TestCase
             $expectedWrites,
             $robotsInfo
         );
+        $this->storeManagerMock->expects($this->once())->method('setCurrentStore')->with(1);
+
         $model->generateXml();
     }
 
diff --git a/app/code/Magento/Store/App/Request/PathInfoProcessor.php b/app/code/Magento/Store/App/Request/PathInfoProcessor.php
index a38ea6d1272e8ab0b4f37dfa179afdebc6bad669..3fa78dc94aa35b34d954161ada04b1660cf3617d 100644
--- a/app/code/Magento/Store/App/Request/PathInfoProcessor.php
+++ b/app/code/Magento/Store/App/Request/PathInfoProcessor.php
@@ -44,7 +44,7 @@ class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProces
 
         if ($store->isUseStoreInUrl()) {
             if (!$request->isDirectAccessFrontendName($storeCode) && $storeCode != Store::ADMIN_CODE) {
-                $this->storeManager->setCurrentStore($storeCode);
+                $this->storeManager->setCurrentStore($store->getCode());
                 $pathInfo = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
                 return $pathInfo;
             } elseif (!empty($storeCode)) {
diff --git a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php
index f2bd401cea3fbcbad932ebffe33635d05d9ba1a9..7d2fb540149671be1e8236eb3615925489f43ed1 100644
--- a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php
+++ b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php
@@ -47,6 +47,7 @@ class PathInfoProcessorTest extends \PHPUnit\Framework\TestCase
         )->with(
             'storeCode'
         )->willReturn($store);
+        $store->expects($this->once())->method('getCode')->will($this->returnValue('storeCode'));
         $store->expects($this->once())->method('isUseStoreInUrl')->will($this->returnValue(true));
         $this->_requestMock->expects(
             $this->once()
diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php
index d899839d43d402b5b8160b086c44aeb822ff7d2f..df4138db30ce0e5739adc9fa49cdfd7e69f7604e 100644
--- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php
@@ -57,6 +57,9 @@ class LinkManagementTest extends \Magento\TestFramework\TestCase\WebapiAbstract
 
             $this->assertArrayHasKey('status', $product);
             $this->assertEquals('1', $product['status']);
+
+            $this->assertArrayHasKey('visibility', $product);
+            $this->assertEquals('1', $product['visibility']);
         }
     }