Skip to content

Commit 52e3a05

Browse files
committed
Merge remote-tracking branch 'tango/MAGETWO-94096' into PR-2008-2.3-tmp
2 parents 872e0fb + f35df7c commit 52e3a05

File tree

1 file changed

+14
-9
lines changed
  • app/code/Magento/Sales/Model/ResourceModel

1 file changed

+14
-9
lines changed

app/code/Magento/Sales/Model/ResourceModel/Grid.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,20 @@ public function refresh($value, $field = null)
9393
{
9494
$select = $this->getGridOriginSelect()
9595
->where(($field ?: $this->mainTableName . '.entity_id') . ' = ?', $value);
96-
return $this->getConnection()->query(
97-
$this->getConnection()
98-
->insertFromSelect(
99-
$select,
100-
$this->getTable($this->gridTableName),
101-
array_keys($this->columns),
102-
AdapterInterface::INSERT_ON_DUPLICATE
103-
)
104-
);
96+
$sql = $this->getConnection()
97+
->insertFromSelect(
98+
$select,
99+
$this->getTable($this->gridTableName),
100+
array_keys($this->columns),
101+
AdapterInterface::INSERT_ON_DUPLICATE
102+
);
103+
104+
$this->addCommitCallback(function () use ($sql) {
105+
$this->getConnection()->query($sql);
106+
});
107+
108+
// need for backward compatibility
109+
return $this->getConnection()->query($sql);
105110
}
106111

107112
/**

0 commit comments

Comments
 (0)