Skip to content

Commit

Permalink
Merge branch '2.2-develop-mainline' into ISSUE-12860
Browse files Browse the repository at this point in the history
  • Loading branch information
p-bystritsky committed Jan 10, 2018
2 parents e5b030a + 5790c16 commit d80c790
Show file tree
Hide file tree
Showing 22 changed files with 210 additions and 64 deletions.
1 change: 1 addition & 0 deletions app/code/Magento/Backup/Model/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu
}
}
$backup->write($this->getResource()->getTableForeignKeysSql());
$backup->write($this->getResource()->getTableTriggersSql());
$backup->write($this->getResource()->getFooter());

$this->getResource()->commitTransaction();
Expand Down
24 changes: 24 additions & 0 deletions app/code/Magento/Backup/Model/ResourceModel/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,30 @@ public function getTableForeignKeysSql($tableName = null)
return $fkScript;
}

/**
* Return triggers fro table(s)
*
* @param string|null $tableName
* @param bool $addDropIfExists
* @return string
*/
public function getTableTriggersSql($tableName = null, $addDropIfExists = true)
{
$triggerScript = '';
if (!$tableName) {
$tables = $this->getTables();
foreach ($tables as $table) {
$tableTriggerScript = $this->_resourceHelper->getTableTriggersSql($table, $addDropIfExists);
if (!empty($tableTriggerScript)) {
$triggerScript .= "\n" . $tableTriggerScript;
}
}
} else {
$triggerScript = $this->getTableTriggersSql($tableName, $addDropIfExists);
}
return $triggerScript;
}

/**
* Retrieve table status
*
Expand Down
36 changes: 36 additions & 0 deletions app/code/Magento/Backup/Model/ResourceModel/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,40 @@ public function restoreTransactionIsolationLevel()
{
$this->getConnection()->query('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
}

/**
* Get create script for triggers
*
* @param string $tableName
* @param boolean $addDropIfExists
* @param boolean $stripDefiner
* @return string
*/
public function getTableTriggersSql($tableName, $addDropIfExists = false, $stripDefiner = true)
{
$script = "--\n-- Triggers structure for table `{$tableName}`\n--\n";
$triggers = $this->getConnection()->query('SHOW TRIGGERS LIKE \''. $tableName . '\'')->fetchAll();

if (!$triggers) {
return '';
}
foreach ($triggers as $trigger) {
if ($addDropIfExists) {
$script .= 'DROP TRIGGER IF EXISTS ' . $trigger['Trigger'] . ";\n";
}
$script .= "delimiter ;;\n";

$triggerData = $this->getConnection()->query('SHOW CREATE TRIGGER '. $trigger['Trigger'])->fetch();
if ($stripDefiner) {
$cleanedScript = preg_replace('/DEFINER=[^\s]*/', '', $triggerData['SQL Original Statement']);
$script .= $cleanedScript . "\n";
} else {
$script .= $triggerData['SQL Original Statement'] . "\n";
}
$script .= ";;\n";
$script .= "delimiter ;\n";
}

return $script;
}
}
36 changes: 36 additions & 0 deletions app/code/Magento/Customer/Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
$this->upgradeVersionTwoZeroTwelve($customerSetup);
}

if (version_compare($context->getVersion(), '2.0.13', '<')) {
$this->upgradeVersionTwoZeroThirteen($customerSetup);
}

$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
$indexer->reindexAll();
$this->eavConfig->clear();
Expand Down Expand Up @@ -663,4 +667,36 @@ private function upgradeCustomerPasswordResetlinkExpirationPeriodConfig($setup)
['path = ?' => \Magento\Customer\Model\Customer::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD]
);
}

/**
* @param CustomerSetup $customerSetup
*/
private function upgradeVersionTwoZeroThirteen(CustomerSetup $customerSetup)
{
$entityAttributes = [
'customer_address' => [
'firstname' => [
'input_filter' => 'trim'
],
'lastname' => [
'input_filter' => 'trim'
],
'middlename' => [
'input_filter' => 'trim'
],
],
'customer' => [
'firstname' => [
'input_filter' => 'trim'
],
'lastname' => [
'input_filter' => 'trim'
],
'middlename' => [
'input_filter' => 'trim'
],
],
];
$this->upgradeAttributes($entityAttributes, $customerSetup);
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Customer" setup_version="2.0.12">
<module name="Magento_Customer" setup_version="2.0.13">
<sequence>
<module name="Magento_Eav"/>
<module name="Magento_Directory"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/
?>
<div>
<?php $block->escapeHtml($block->getMethod()->getTitle());?>
<?= $block->getMethod()->getTitle()
? $block->escapeHtml($block->getMethod()->getTitle())
: $block->escapeHtml(__('Payment method')); ?>
<?= $block->escapeHtml(__(' is not available. You still can process offline actions.')) ?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@
</tr>
</thead>
<?php foreach ($_creditmemo->getAllItems() as $_item): ?>
<?php
if ($_item->getOrderItem()->getParentItem()) {
continue;
}
?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getOrderItem()->getParentItem()) : ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
<tfoot class="order-totals">
<?= $block->getChildHtml('creditmemo_totals') ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@
</tr>
</thead>
<?php foreach ($_invoice->getAllItems() as $_item): ?>
<?php
if ($_item->getOrderItem()->getParentItem()) {
continue;
}
?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getOrderItem()->getParentItem()) : ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
<tfoot class="order-totals">
<?= $block->getChildHtml('invoice_totals') ?>
Expand Down
13 changes: 5 additions & 8 deletions app/code/Magento/Sales/view/frontend/templates/email/items.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@
</tr>
</thead>
<?php foreach ($_items as $_item): ?>
<?php
if ($_item->getParentItem()) {
continue;
}
?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getParentItem()) : ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
<tfoot class="order-totals">
<?= $block->getChildHtml('order_totals') ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
</tr>
</thead>
<?php foreach ($_shipment->getAllItems() as $_item): ?>
<?php
if ($_item->getOrderItem()->getParentItem()) {
continue;
}
?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getOrderItem()->getParentItem()) : ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
</table>
<?php endif; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@
</thead>
<?php $_items = $_creditmemo->getAllItems(); ?>
<?php foreach ($_items as $_item): ?>
<?php if ($_item->getOrderItem()->getParentItem()) {
continue;
} ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getOrderItem()->getParentItem()): ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
<tfoot>
<?= $block->getTotalsHtml($_creditmemo) ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
</thead>
<?php $_items = $_invoice->getAllItems(); ?>
<?php foreach ($_items as $_item): ?>
<?php if ($_item->getOrderItem()->getParentItem()) {
continue;
} ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getOrderItem()->getParentItem()) : ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
<tfoot>
<?= $block->getInvoiceTotalsHtml($_invoice) ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
</thead>
<?php $_items = $_creditmemo->getAllItems(); ?>
<?php foreach ($_items as $_item): ?>
<?php if ($_item->getOrderItem()->getParentItem()): ?>
continue;
<?php endif; ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getOrderItem()->getParentItem()): ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
<tfoot>
<?= $block->getTotalsHtml($_creditmemo) ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
</thead>
<?php $_items = $_invoice->getItemsCollection(); ?>
<?php foreach ($_items as $_item): ?>
<?php if ($_item->getOrderItem()->getParentItem()): ?>
continue;
<?php if (!$_item->getOrderItem()->getParentItem()): ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endforeach; ?>
<tfoot>
<?= $block->getInvoiceTotalsHtml($_invoice) ?>
Expand Down
11 changes: 5 additions & 6 deletions app/code/Magento/Shipping/view/frontend/templates/items.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@
</thead>
<?php $_items = $_shipment->getAllItems(); ?>
<?php foreach ($_items as $_item): ?>
<?php if ($_item->getOrderItem()->getParentItem()) {
continue;
} ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php if (!$_item->getOrderItem()->getParentItem()) : ?>
<tbody>
<?= $block->getItemHtml($_item) ?>
</tbody>
<?php endif; ?>
<?php endforeach; ?>
</table>
</div>
Expand Down
5 changes: 5 additions & 0 deletions app/code/Magento/Ui/view/base/web/js/form/element/region.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ define([
return;
}
option = options[value];

if (typeof option === 'undefined') {
return;
}

defaultPostCodeResolver.setUseDefaultPostCode(!option['is_zipcode_optional']);

if (this.skipValidation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ body {
// ToDo UI: should be moved to messages
.notices-wrapper {
margin: 0 3rem;
min-height: 5rem;
.messages {
margin-bottom: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,16 @@
}
}

//
// Category page 1 column layout
// ---------------------------------------------

.catalog-category-view.page-layout-1column {
.column.main {
min-height: inherit;
}
}

}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,16 @@
}
}
}

//
// Category page 1 column layout
// ---------------------------------------------

.catalog-category-view.page-layout-1column {
.column.main {
min-height: inherit;
}
}
}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
border-bottom-left-radius: 0;
border-top-left-radius: 0;
margin-left: -1px;
white-space: nowrap;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getAttributeMetadataDataProvider()
Customer::FIRSTNAME,
[
AttributeMetadata::FRONTEND_INPUT => 'text',
AttributeMetadata::INPUT_FILTER => '',
AttributeMetadata::INPUT_FILTER => 'trim',
AttributeMetadata::STORE_LABEL => 'First Name',
AttributeMetadata::MULTILINE_COUNT => 0,
AttributeMetadata::VALIDATION_RULES => [
Expand Down
Loading

0 comments on commit d80c790

Please sign in to comment.