Skip to content

Commit 17d58de

Browse files
author
Maksym Aposov
committed
MAGETWO-51538: Exception when perform advanced search by space in any field
1 parent 29808b0 commit 17d58de

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

app/code/Magento/Indexer/Model/Source/ServiceSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private function getRequestedFields(SearchResults $list, array $fields)
6969
foreach ($list->getItems() as $key => $item) {
7070
foreach (array_keys($fields) as $fieldName) {
7171
if (!isset($item[$fieldName])) {
72-
throw new NotFoundException(__("Field {$fieldName} not found"));
72+
throw new NotFoundException(__("Field '%1' not found", $fieldName));
7373
}
7474

7575
$requestedData[$key][$fieldName] = $item[$fieldName];

dev/tests/integration/testsuite/Magento/Framework/Search/Adapter/Mysql/AdapterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ private function assertProductIds($queryResponse, $expectedIds)
109109
$actualIds[] = $document->getId();
110110
}
111111
sort($actualIds);
112+
sort($expectedIds);
112113
$this->assertEquals($expectedIds, $actualIds);
113114
}
114115

lib/internal/Magento/Framework/Search/Request/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function create()
132132
/** @var array $data */
133133
$data = $this->config->get($requestName);
134134
if ($data === null) {
135-
throw new NonExistingRequestNameException(new Phrase("Request name '{$requestName}' doesn't exist."));
135+
throw new NonExistingRequestNameException(new Phrase("Request name '%1' doesn't exist.", [$requestName]));
136136
}
137137

138138
$data = $this->binder->bind($data, $this->data);

0 commit comments

Comments
 (0)