Skip to content

Commit 87dff07

Browse files
author
Oleksandr Iegorov
committed
MC-19607: Mass delete deletes all products
1 parent 55519da commit 87dff07

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/code/Magento/CatalogSearch/Ui/DataProvider/Product/AddFulltextFilterToCollection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function addFilter(Collection $collection, $field, $condition = null)
4040
if (isset($condition['fulltext']) && (string)$condition['fulltext'] !== '') {
4141
$this->searchCollection->addBackendSearchFilter($condition['fulltext']);
4242
$productIds = $this->searchCollection->load()->getAllIds();
43+
if (empty($productIds)) {
44+
//add dummy id to prevent returning full unfiltered collection
45+
$productIds = -1;
46+
}
4347
$collection->addIdFilter($productIds);
4448
}
4549
}

0 commit comments

Comments
 (0)