Skip to content

Commit 81b3e54

Browse files
author
Natalia Momotenko
committed
Merge remote-tracking branch 'origin/develop' into UI
2 parents d261e36 + c04232b commit 81b3e54

File tree

14 files changed

+517
-38
lines changed

14 files changed

+517
-38
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Tab;
77

8+
use Magento\Framework\Api\SimpleDataObjectConverter;
9+
810
/**
911
* Product inventory data
1012
*/
@@ -133,7 +135,7 @@ public function getFieldValue($field)
133135
{
134136
$stockItem = $this->getStockItem();
135137
if ($stockItem->getItemId()) {
136-
$method = 'get' . \Magento\Framework\Api\SimpleDataObjectConverter::snakeCaseToUpperCamelCase($field);
138+
$method = 'get' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($field);
137139
if (method_exists($stockItem, $method)) {
138140
return $stockItem->{$method}();
139141
}
@@ -149,7 +151,7 @@ public function getConfigFieldValue($field)
149151
{
150152
$stockItem = $this->getStockItem();
151153
if ($stockItem->getItemId()) {
152-
$method = 'getUseConfig' . \Magento\Framework\Api\SimpleDataObjectConverter::snakeCaseToUpperCamelCase(
154+
$method = 'getUseConfig' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase(
153155
$field
154156
);
155157
if (method_exists($stockItem, $method)) {

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
class="select" disabled="disabled">
5151
<option value="1"><?php echo __('Yes') ?></option>
5252
<option
53-
value="0"<?php if ($block->getConfigFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?php echo __('No') ?></option>
53+
value="0"<?php if ($block->getFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?php echo __('No') ?></option>
5454
</select>
5555
</div>
5656
<div class="field choice">

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/tab/inventory.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="control">
2525
<select id="inventory_manage_stock" name="<?php echo $block->getFieldSuffix() ?>[stock_data][manage_stock]" <?php echo $_readonly;?>>
2626
<option value="1"><?php echo __('Yes') ?></option>
27-
<option value="0"<?php if ($block->getConfigFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?php echo __('No') ?></option>
27+
<option value="0"<?php if ($block->getFieldValue('manage_stock') == 0): ?> selected="selected"<?php endif; ?>><?php echo __('No') ?></option>
2828
</select>
2929
<input type="hidden" id="inventory_manage_stock_default" value="<?php echo $block->getDefaultConfigValue('manage_stock'); ?>">
3030
<?php $_checked = ($block->getFieldValue('use_config_manage_stock') || $block->IsNew()) ? 'checked="checked"' : '' ?>

app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<ul data-mage-init='{"menu":[]}'>
2626
<% if (data.items.length) { %>
2727
<% _.each(data.items, function(value){ %>
28-
<li <%- data.optionData(value) %>><a href="#"><%- value.label %></a></li>
28+
<li <%= data.optionData(value) %>><a href="#"><%- value.label %></a></li>
2929
<% }); %>
3030
<% } else { %><span class="mage-suggest-no-records"><%- data.noRecordsText %></span><% } %>
3131
</ul>
@@ -50,7 +50,7 @@
5050
data: {'template_id': data.id}
5151
});
5252
});
53-
53+
5454
$suggest.mage('suggest', <?php echo $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getSelectorOptions())?>)
5555
.on('suggestselect', function (e, ui) {
5656
$(this).val('');

app/code/Magento/Customer/Block/Address/Edit.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,22 @@ protected function _prepareLayout()
106106
if ($addressId = $this->getRequest()->getParam('id')) {
107107
try {
108108
$this->_address = $this->_addressRepository->getById($addressId);
109+
if ($this->_address->getCustomerId() != $this->_customerSession->getCustomerId()) {
110+
$this->_address = null;
111+
}
109112
} catch (NoSuchEntityException $e) {
110113
$this->_address = null;
111114
}
112115
}
113116

114117
if ($this->_address === null || !$this->_address->getId()) {
115118
$this->_address = $this->addressDataFactory->create();
116-
$this->_address->setPrefix(
117-
$this->getCustomer()->getPrefix()
118-
)->setFirstname(
119-
$this->getCustomer()->getFirstname()
120-
)->setMiddlename(
121-
$this->getCustomer()->getMiddlename()
122-
)->setLastname(
123-
$this->getCustomer()->getLastname()
124-
)->setSuffix(
125-
$this->getCustomer()->getSuffix()
126-
);
119+
$customer = $this->getCustomer();
120+
$this->_address->setPrefix($customer->getPrefix());
121+
$this->_address->setFirstname($customer->getFirstname());
122+
$this->_address->setMiddlename($customer->getMiddlename());
123+
$this->_address->setLastname($customer->getLastname());
124+
$this->_address->setSuffix($customer->getSuffix());
127125
}
128126

129127
$this->pageConfig->getTitle()->set($this->getTitle());

0 commit comments

Comments
 (0)