Skip to content

Commit 978d952

Browse files
committed
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-83571
2 parents ee6ea1e + 5790c16 commit 978d952

File tree

46 files changed

+373
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+373
-107
lines changed

COPYING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2013-2017 Magento, Inc.
1+
Copyright © 2013-2018 Magento, Inc.
22

33
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license
44

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
<label>European Union Countries</label>
216216
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
217217
</field>
218-
<field id="destinations" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
218+
<field id="destinations" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
219219
<label>Top destinations</label>
220220
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
221221
</field>

app/code/Magento/Backup/Model/Db.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu
173173
}
174174
}
175175
$backup->write($this->getResource()->getTableForeignKeysSql());
176+
$backup->write($this->getResource()->getTableTriggersSql());
176177
$backup->write($this->getResource()->getFooter());
177178

178179
$this->getResource()->commitTransaction();

app/code/Magento/Backup/Model/ResourceModel/Db.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,30 @@ public function getTableForeignKeysSql($tableName = null)
114114
return $fkScript;
115115
}
116116

117+
/**
118+
* Return triggers fro table(s)
119+
*
120+
* @param string|null $tableName
121+
* @param bool $addDropIfExists
122+
* @return string
123+
*/
124+
public function getTableTriggersSql($tableName = null, $addDropIfExists = true)
125+
{
126+
$triggerScript = '';
127+
if (!$tableName) {
128+
$tables = $this->getTables();
129+
foreach ($tables as $table) {
130+
$tableTriggerScript = $this->_resourceHelper->getTableTriggersSql($table, $addDropIfExists);
131+
if (!empty($tableTriggerScript)) {
132+
$triggerScript .= "\n" . $tableTriggerScript;
133+
}
134+
}
135+
} else {
136+
$triggerScript = $this->getTableTriggersSql($tableName, $addDropIfExists);
137+
}
138+
return $triggerScript;
139+
}
140+
117141
/**
118142
* Retrieve table status
119143
*

app/code/Magento/Backup/Model/ResourceModel/Helper.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,40 @@ public function restoreTransactionIsolationLevel()
337337
{
338338
$this->getConnection()->query('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
339339
}
340+
341+
/**
342+
* Get create script for triggers
343+
*
344+
* @param string $tableName
345+
* @param boolean $addDropIfExists
346+
* @param boolean $stripDefiner
347+
* @return string
348+
*/
349+
public function getTableTriggersSql($tableName, $addDropIfExists = false, $stripDefiner = true)
350+
{
351+
$script = "--\n-- Triggers structure for table `{$tableName}`\n--\n";
352+
$triggers = $this->getConnection()->query('SHOW TRIGGERS LIKE \''. $tableName . '\'')->fetchAll();
353+
354+
if (!$triggers) {
355+
return '';
356+
}
357+
foreach ($triggers as $trigger) {
358+
if ($addDropIfExists) {
359+
$script .= 'DROP TRIGGER IF EXISTS ' . $trigger['Trigger'] . ";\n";
360+
}
361+
$script .= "delimiter ;;\n";
362+
363+
$triggerData = $this->getConnection()->query('SHOW CREATE TRIGGER '. $trigger['Trigger'])->fetch();
364+
if ($stripDefiner) {
365+
$cleanedScript = preg_replace('/DEFINER=[^\s]*/', '', $triggerData['SQL Original Statement']);
366+
$script .= $cleanedScript . "\n";
367+
} else {
368+
$script .= $triggerData['SQL Original Statement'] . "\n";
369+
}
370+
$script .= ";;\n";
371+
$script .= "delimiter ;\n";
372+
}
373+
374+
return $script;
375+
}
340376
}

app/code/Magento/Bundle/view/frontend/templates/sales/order/creditmemo/items/renderer.phtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
<?php $items = $block->getChildren($parentItem) ?>
1414
<?php $_order = $block->getItem()->getOrderItem()->getOrder() ?>
15-
<?php $_count = count($items) ?>
1615
<?php $_index = 0 ?>
1716

1817
<?php $_prevOptionId = '' ?>

app/code/Magento/Bundle/view/frontend/templates/sales/order/invoice/items/renderer.phtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<?php $_order = $block->getItem()->getOrderItem()->getOrder() ?>
1313

1414
<?php $items = $block->getChildren($parentItem) ?>
15-
<?php $_count = count($items) ?>
1615
<?php $_index = 0 ?>
1716

1817
<?php $_prevOptionId = '' ?>

app/code/Magento/Bundle/view/frontend/templates/sales/order/items/renderer.phtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
?>
1111
<?php $parentItem = $block->getItem() ?>
1212
<?php $items = array_merge([$parentItem], $parentItem->getChildrenItems()); ?>
13-
<?php $_count = count($items) ?>
1413
<?php $_index = 0 ?>
1514

1615
<?php $_prevOptionId = '' ?>

app/code/Magento/Bundle/view/frontend/templates/sales/order/shipment/items/renderer.phtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<?php $parentItem = $block->getItem() ?>
1313
<?php $items = array_merge([$parentItem->getOrderItem()], $parentItem->getOrderItem()->getChildrenItems()) ?>
1414
<?php $shipItems = $block->getChildren($parentItem) ?>
15-
<?php $_count = count($items) ?>
1615
<?php $_index = 0 ?>
1716

1817
<?php $_prevOptionId = '' ?>

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-save-processor/payload-extender.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
2+
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
55
define(function () {

0 commit comments

Comments
 (0)