diff --git a/app/code/Magento/Cms/Model/BlockRepository.php b/app/code/Magento/Cms/Model/BlockRepository.php index a06c5fac1bc4e..5f8ec399e9bd6 100644 --- a/app/code/Magento/Cms/Model/BlockRepository.php +++ b/app/code/Magento/Cms/Model/BlockRepository.php @@ -154,25 +154,10 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria $this->collectionProcessor->process($criteria, $collection); - $blocks = []; - /** @var Block $blockModel */ - foreach ($collection as $blockModel) { - $blockData = $this->dataBlockFactory->create(); - $this->dataObjectHelper->populateWithArray( - $blockData, - $blockModel->getData(), - \Magento\Cms\Api\Data\BlockInterface::class - ); - $blocks[] = $this->dataObjectProcessor->buildOutputDataArray( - $blockData, - \Magento\Cms\Api\Data\BlockInterface::class - ); - } - /** @var Data\BlockSearchResultsInterface $searchResults */ $searchResults = $this->searchResultsFactory->create(); $searchResults->setSearchCriteria($criteria); - $searchResults->setItems($blocks); + $searchResults->setItems($collection->getItems()); $searchResults->setTotalCount($collection->getSize()); return $searchResults; }