Skip to content

Commit 249ad65

Browse files
author
Olga Kopylova
committed
Merge remote-tracking branch 'mainline/develop' into PR_Branch
2 parents ef24f1e + d2d0db2 commit 249ad65

File tree

48 files changed

+1388
-573
lines changed

Some content is hidden

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

48 files changed

+1388
-573
lines changed

app/code/Magento/Backend/Block/Menu.php

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,24 @@ protected function _renderItemCssClass($menuItem, $level)
210210
*/
211211
protected function _renderAnchor($menuItem, $level)
212212
{
213-
return '<a href="' . $menuItem->getUrl() . '" ' . $this->_renderItemAnchorTitle(
214-
$menuItem
215-
) . $this->_renderItemOnclickFunction(
216-
$menuItem
217-
) . ' class="' . $this->_renderAnchorCssClass(
218-
$menuItem,
219-
$level
220-
) . '">' . '<span>' . $this->_getAnchorLabel(
221-
$menuItem
222-
) . '</span>' . '</a>';
213+
if ($level == 1 && $menuItem->getUrl() == '#') {
214+
$output = '<strong class="submenu-group-title" role="presentation">'
215+
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
216+
. '</strong>';
217+
} else {
218+
$output = '<a href="' . $menuItem->getUrl() . '" ' . $this->_renderItemAnchorTitle(
219+
$menuItem
220+
) . $this->_renderItemOnclickFunction(
221+
$menuItem
222+
) . ' class="' . $this->_renderAnchorCssClass(
223+
$menuItem,
224+
$level
225+
) . '">' . '<span>' . $this->_getAnchorLabel(
226+
$menuItem
227+
) . '</span>' . '</a>';
228+
}
229+
230+
return $output;
223231
}
224232

225233
/**
@@ -397,15 +405,16 @@ protected function _columnBrake($items, $limit)
397405
* @param \Magento\Backend\Model\Menu\Item $menuItem
398406
* @param int $level
399407
* @param int $limit
408+
* @param $id int
400409
* @return string HTML code
401410
*/
402-
protected function _addSubMenu($menuItem, $level, $limit)
411+
protected function _addSubMenu($menuItem, $level, $limit, $id = null)
403412
{
404413
$output = '';
405414
if (!$menuItem->hasChildren()) {
406415
return $output;
407416
}
408-
$output .= '<div class="submenu">';
417+
$output .= '<div class="submenu"' . ($level == 0 && isset($id) ? ' aria-labelledby="' . $id . '"' : '') . '>';
409418
$colStops = null;
410419
if ($level == 0 && $limit) {
411420
$colStops = $this->_columnBrake($menuItem->getChildren(), $limit);
@@ -426,6 +435,7 @@ protected function _addSubMenu($menuItem, $level, $limit)
426435
* @param int $limit
427436
* @param array $colBrakes
428437
* @return string HTML
438+
* @SuppressWarnings(PHPMD.NPathComplexity)
429439
*/
430440
public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
431441
{
@@ -443,18 +453,21 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
443453
$output .= '</ul></li><li class="column"><ul role="menu">';
444454
}
445455

456+
$id = $this->getJsId($menuItem->getId());
446457
$output .= '<li ' . $this->getUiId(
447458
$menuItem->getId()
448459
) . ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass(
449460
$menuItem,
450461
$level
451-
) . '" role="menu-item">' . $this->_renderAnchor(
462+
) . ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
463+
. '" role="menu-item">' . $this->_renderAnchor(
452464
$menuItem,
453465
$level
454466
) . $this->_addSubMenu(
455467
$menuItem,
456468
$level,
457-
$limit
469+
$limit,
470+
$id
458471
) . '</li>';
459472
$itemPosition++;
460473
}

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/Cms/Ui/DataProvider/Block/Row/Actions.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ public function __construct(UrlInterface $urlBuilder)
3434
/**
3535
* Get data
3636
*
37-
* @param array $dataRow
38-
* @return mixed
37+
* @param array $rowData
38+
* @param array $rowActionConfig
39+
* @return array
3940
*/
40-
public function getData(array $dataRow)
41+
public function getData(array $rowData, array $rowActionConfig = [])
4142
{
4243
return [
4344
'edit' => [
44-
'href' => $this->urlBuilder->getUrl(static::URL_PATH, ['block_id' => $dataRow['block_id']]),
45+
'href' => $this->urlBuilder->getUrl(
46+
isset($rowActionConfig['url_path']) ? $rowActionConfig['url_path'] : static::URL_PATH,
47+
['block_id' => $rowData['block_id']]
48+
),
4549
'label' => __('Edit'),
4650
]
4751
];

app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,27 @@ public function __construct(UrlBuilder $actionUrlBuilder, UrlInterface $urlBuild
4444
/**
4545
* Get data
4646
*
47-
* @param array $dataRow
48-
* @return mixed
47+
* @param array $rowData
48+
* @param array $rowActionConfig
49+
* @return array
4950
*/
50-
public function getData(array $dataRow)
51+
public function getData(array $rowData, array $rowActionConfig = [])
5152
{
5253
return [
5354
'edit' => [
54-
'href' => $this->urlBuilder->getUrl(static::URL_PATH, ['page_id' => $dataRow['page_id']]),
55+
'href' => $this->urlBuilder->getUrl(
56+
isset($rowActionConfig['url_path']) ? $rowActionConfig['url_path'] : static::URL_PATH,
57+
['page_id' => $rowData['page_id']]
58+
),
5559
'label' => __('Edit'),
5660
'hidden' => true,
5761

5862
],
5963
'preview' => [
6064
'href' => $this->actionUrlBuilder->getUrl(
61-
$dataRow['identifier'],
62-
isset($dataRow['_first_store_id']) ? $dataRow['_first_store_id'] : null,
63-
isset($dataRow['store_code']) ? $dataRow['store_code'] : null
65+
$rowData['identifier'],
66+
isset($rowData['_first_store_id']) ? $rowData['_first_store_id'] : null,
67+
isset($rowData['store_code']) ? $rowData['store_code'] : null
6468
),
6569
'label' => __('Preview'),
6670
]

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)