Skip to content

Commit

Permalink
Fix attributepage no buckets error
Browse files Browse the repository at this point in the history
  • Loading branch information
0m3r committed Nov 27, 2020
1 parent adaa358 commit 3708615
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Swissup\SearchMysqlLegacy\Plugin\CatalogSearch\Model\Adapter\Aggregation\Checker\Query;

class CatalogView
{
/**
* @var \Magento\Framework\App\RequestInterface
*/
private $request;

/**
*
* @param \Magento\Framework\App\RequestInterface $request
*/
public function __construct(
\Magento\Framework\App\RequestInterface $request
) {
$this->request = $request;
}

/**
*
* @return boolean
*/
protected function isAttributePage()
{
return $this->request->getFullActionName() === 'attributepages_page_view';
}

/**
*
* @param \Magento\CatalogSearch\Model\Adapter\Aggregation\Checker\Query\CatalogView $subject
* @param boolean $result
* @return boolean
*/
public function afterIsApplicable(
\Magento\CatalogSearch\Model\Adapter\Aggregation\Checker\Query\CatalogView $subject,
$result
) {

if ($this->isAttributePage()) {
$result = true;
}

return $result;
}
}
5 changes: 5 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,9 @@
<type name="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection">
<plugin name="load_entities_legacy_mysql" type="Swissup\SearchMysqlLegacy\Plugin\CatalogSearch\Model\ResourceModel\Fulltext\Collection" />
</type>

<type name="Magento\CatalogSearch\Model\Adapter\Aggregation\Checker\Query\CatalogView">
<plugin name="is_applicable" type="Swissup\SearchMysqlLegacy\Plugin\CatalogSearch\Model\Adapter\Aggregation\Checker\Query\CatalogView" />
</type>

</config>

0 comments on commit 3708615

Please sign in to comment.