Skip to content

Commit 2dd907a

Browse files
authored
Merge pull request #4267 from magento-mpi/PR-05-28-2019
[mpi] MAGETWO-93497: admin/url/custom cause media directives to break
2 parents 3c30fb6 + 671183c commit 2dd907a

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private function generateRequest($attributeType, $container, $useFulltext)
101101
}
102102
}
103103
/** @var $attribute Attribute */
104-
if (!$attribute->getIsSearchable() || in_array($attribute->getAttributeCode(), ['price', 'sku'], true)) {
104+
if (!$attribute->getIsSearchable() || in_array($attribute->getAttributeCode(), ['price'], true)) {
105105
// Some fields have their own specific handlers
106106
continue;
107107
}

app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\CatalogSearch\Model\Search\RequestGenerator\GeneratorResolver;
1010
use Magento\CatalogSearch\Model\Search\RequestGenerator\GeneratorInterface;
1111

12+
/**
13+
* Test for \Magento\CatalogSearch\Model\Search\RequestGenerator
14+
*/
1215
class RequestGeneratorTest extends \PHPUnit\Framework\TestCase
1316
{
1417
/** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */
@@ -61,7 +64,7 @@ public function attributesProvider()
6164
return [
6265
[
6366
[
64-
'quick_search_container' => ['queries' => 0, 'filters' => 0, 'aggregations' => 0],
67+
'quick_search_container' => ['queries' => 1, 'filters' => 0, 'aggregations' => 0],
6568
'advanced_search_container' => ['queries' => 0, 'filters' => 0, 'aggregations' => 0],
6669
'catalog_view_container' => ['queries' => 0, 'filters' => 0, 'aggregations' => 0]
6770
],

app/code/Magento/CatalogSearch/etc/search_request.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<queryReference clause="must" ref="visibility"/>
2020
</query>
2121
<query xsi:type="matchQuery" value="$search_term$" name="search">
22-
<match field="sku"/>
2322
<match field="*"/>
2423
</query>
2524
<query xsi:type="filteredQuery" name="category">

app/code/Magento/Cms/Helper/Wysiwyg/Images.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,7 @@ public function getCurrentUrl()
239239
{
240240
if (!$this->_currentUrl) {
241241
$path = $this->getCurrentPath();
242-
$mediaUrl = $this->_storeManager->getStore(
243-
$this->_storeId
244-
)->getBaseUrl(
245-
\Magento\Framework\UrlInterface::URL_TYPE_MEDIA
246-
);
242+
$mediaUrl = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
247243
$this->_currentUrl = $mediaUrl . $this->_directory->getRelativePath($path) . '/';
248244
}
249245
return $this->_currentUrl;

dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use Magento\Framework\App\Filesystem\DirectoryList;
99

10+
/**
11+
* @magentoAppArea adminhtml
12+
*/
1013
class ImagesTest extends \PHPUnit\Framework\TestCase
1114
{
1215
public function testGetStorageRoot()
@@ -23,6 +26,12 @@ public function testGetStorageRoot()
2326
$this->assertStringStartsWith($mediaPath, $helper->getStorageRoot());
2427
}
2528

29+
/**
30+
* @magentoConfigFixture default_store admin/url/use_custom 1
31+
* @magentoConfigFixture default_store admin/url/custom http://backend/
32+
* @magentoConfigFixture admin_store web/secure/base_url http://backend/
33+
* @magentoConfigFixture admin_store web/unsecure/base_url http://backend/
34+
*/
2635
public function testGetCurrentUrl()
2736
{
2837
$helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(

0 commit comments

Comments
 (0)