Skip to content

Commit 293c9fd

Browse files
committed
removed unit test failures
1 parent 9a321d6 commit 293c9fd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ protected function reindex(): void
205205
private function reindexStore($store): void
206206
{
207207
// Ensure the same adapter instance that created the TEMP table is used for all operations
208-
$this->connection = $this->tableMaintainer->getConnection();
208+
// phpcs:ignore
209+
$this->connection = $this->tableMaintainer->getSameAdapterConnection();
209210
$this->reindexRootCategory($store);
210211
$this->reindexAnchorCategories($store);
211212
$this->reindexNonAnchorCategories($store);

app/code/Magento/Catalog/Model/Indexer/Category/Product/TableMaintainer.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,25 @@ public function __construct(
6969
*
7070
* @return AdapterInterface
7171
*/
72-
public function getConnection()
72+
private function getConnection()
7373
{
7474
if (!isset($this->connection)) {
7575
$this->connection = $this->resource->getConnection();
7676
}
7777
return $this->connection;
7878
}
7979

80+
/**
81+
* Expose connection so callers can use the same adapter instance
82+
* that created temporary tables.
83+
*
84+
* @return AdapterInterface
85+
*/
86+
public function getSameAdapterConnection(): AdapterInterface
87+
{
88+
return $this->getConnection();
89+
}
90+
8091
/**
8192
* Return validated table name
8293
*

0 commit comments

Comments
 (0)