Skip to content

Commit 5b9888b

Browse files
committed
MAGETWO-70883: Prevent change log entry when nothing has changed #4893
- Coding Style fixes
1 parent e21bd31 commit 5b9888b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

app/etc/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,4 +1330,11 @@
13301330
<argument name="configSource" xsi:type="object">Magento\Config\App\Config\Source\EnvironmentConfigSource</argument>
13311331
</arguments>
13321332
</type>
1333+
<type name="Magento\Framework\Mview\View\Subscription">
1334+
<arguments>
1335+
<argument name="ignoredUpdateColumns" xsi:type="array">
1336+
<item name="updated_at" xsi:type="string">updated_at</item>
1337+
</argument>
1338+
</arguments>
1339+
</type>
13331340
</config>

lib/internal/Magento/Framework/Mview/View/Subscription.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use Magento\Framework\App\ResourceConnection;
1212
use Magento\Framework\DB\Ddl\Trigger;
13+
use Magento\Framework\Mview\View\StateInterface;
1314

1415
class Subscription implements SubscriptionInterface
1516
{
@@ -58,7 +59,7 @@ class Subscription implements SubscriptionInterface
5859
*
5960
* @var array
6061
*/
61-
protected $ignoredUpdateColumns = ['updated_at'];
62+
private $ignoredUpdateColumns = [];
6263

6364
/**
6465
* @var Resource
@@ -72,14 +73,16 @@ class Subscription implements SubscriptionInterface
7273
* @param \Magento\Framework\Mview\ViewInterface $view
7374
* @param string $tableName
7475
* @param string $columnName
76+
* @param array $ignoredUpdateColumns
7577
*/
7678
public function __construct(
7779
ResourceConnection $resource,
7880
\Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory,
7981
\Magento\Framework\Mview\View\CollectionInterface $viewCollection,
8082
\Magento\Framework\Mview\ViewInterface $view,
8183
$tableName,
82-
$columnName
84+
$columnName,
85+
$ignoredUpdateColumns = []
8386
) {
8487
$this->connection = $resource->getConnection();
8588
$this->triggerFactory = $triggerFactory;
@@ -88,6 +91,7 @@ public function __construct(
8891
$this->tableName = $tableName;
8992
$this->columnName = $columnName;
9093
$this->resource = $resource;
94+
$this->ignoredUpdateColumns = $ignoredUpdateColumns;
9195
}
9296

9397
/**
@@ -162,7 +166,7 @@ public function remove()
162166
protected function getLinkedViews()
163167
{
164168
if (!$this->linkedViews) {
165-
$viewList = $this->viewCollection->getViewsByStateMode(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED);
169+
$viewList = $this->viewCollection->getViewsByStateMode(StateInterface::MODE_ENABLED);
166170

167171
foreach ($viewList as $view) {
168172
/** @var \Magento\Framework\Mview\ViewInterface $view */

0 commit comments

Comments
 (0)