Skip to content

Commit b38d9f6

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

File tree

64 files changed

+1254
-265
lines changed

Some content is hidden

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

64 files changed

+1254
-265
lines changed

.htaccess

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,6 @@
170170

171171
</IfModule>
172172

173-
############################################
174-
## By default allow all access
175-
176-
Order allow,deny
177-
Allow from all
178-
179173
###########################################
180174
## Deny access to release notes to prevent disclosure of the installed Magento version
181175

.htaccess.sample

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@
167167

168168
</IfModule>
169169

170-
############################################
171-
## By default allow all access
172-
173-
Order allow,deny
174-
Allow from all
175-
176170
###########################################
177171
## Deny access to release notes to prevent disclosure of the installed Magento version
178172

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/view/base/web/js/price-utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
* See COPYING.txt for license details.
44
*/
55
define([
6+
'jquery',
67
'underscore'
7-
], function (_) {
8+
], function ($, _) {
89
'use strict';
910

1011
var globalPriceFormat = {

app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ $class = ($_option->getIsRequire()) ? ' required' : '';
3333
<input type="text"
3434
id="options_<?php echo $_option->getId() ?>_text"
3535
class="input-text product-custom-option"
36-
<?php if (!empty($_textValidate)) {
37-
echo 'data-validate=' . json_encode($_textValidate);
38-
} ?>
36+
<?php if (!empty($_textValidate)) {?>
37+
data-validate="<?php echo $block->escapeHtml(json_encode($_textValidate));?>"
38+
<?php } ?>
3939
name="options[<?php echo $_option->getId() ?>]"
4040
value="<?php echo $block->escapeHtml($block->getDefaultValue()) ?>"/>
4141
<?php elseif ($_option->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_AREA): ?>
@@ -49,9 +49,9 @@ $class = ($_option->getIsRequire()) ? ' required' : '';
4949
?>
5050
<textarea id="options_<?php echo $_option->getId() ?>_text"
5151
class="product-custom-option"
52-
<?php if (!empty($_textAreaValidate)) {
53-
echo 'data-validate=' . json_encode($_textAreaValidate);
54-
} ?>
52+
<?php if (!empty($_textAreaValidate)) {?>
53+
data-validate="<?php echo $block->escapeHtml(json_encode($_textAreaValidate));?>"
54+
<?php } ?>
5555
name="options[<?php echo $_option->getId() ?>]"
5656
rows="5"
5757
cols="25"><?php echo $block->escapeHtml($block->getDefaultValue()) ?></textarea>

app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ define([
3939

4040
submitForm: function(form) {
4141
var self = this;
42-
if (form.has('input[type="file"]').length) {
42+
if (form.has('input[type="file"]').length && form.find('input[type="file"]').val() !== '') {
4343
self.element.off('submit');
4444
form.submit();
4545
} else {

app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Remove.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\CatalogUrlRewrite\Model\Category\Plugin\Category;
77

8-
use Magento\Catalog\Model\Category;
8+
use Magento\Catalog\Api\Data\CategoryInterface;
99
use Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider;
1010
use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
1111
use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator;
@@ -41,15 +41,20 @@ public function __construct(
4141
/**
4242
* Remove product urls from storage
4343
*
44-
* @param Category $category
44+
* @param \Magento\Catalog\Model\Resource\Category $subject
4545
* @param callable $proceed
46+
* @param CategoryInterface $category
4647
* @return mixed
48+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4749
*/
48-
public function aroundDelete(Category $category, \Closure $proceed)
49-
{
50+
public function aroundDelete(
51+
\Magento\Catalog\Model\Resource\Category $subject,
52+
\Closure $proceed,
53+
CategoryInterface $category
54+
) {
5055
$categoryIds = $this->childrenCategoriesProvider->getChildrenIds($category, true);
5156
$categoryIds[] = $category->getId();
52-
$result = $proceed();
57+
$result = $proceed($category);
5358
foreach ($categoryIds as $categoryId) {
5459
$this->deleteRewritesForCategory($categoryId);
5560
}

app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
<type name="Magento\Store\Model\Resource\Group">
1313
<plugin name="group_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Store\Group"/>
1414
</type>
15-
<type name="Magento\Catalog\Model\Category">
16-
<plugin name="category_delete_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Remove"/>
17-
</type>
1815
<type name="Magento\CatalogImportExport\Model\Import\Product">
1916
<plugin name="import_save_plugin" type="Magento\CatalogUrlRewrite\Model\Product\Plugin\Import"/>
2017
</type>
2118
<type name="Magento\Catalog\Model\Resource\Category">
2219
<plugin name="category_move_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Move"/>
20+
<plugin name="category_delete_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Remove"/>
2321
</type>
2422
<type name="Magento\UrlRewrite\Model\StorageInterface">
2523
<plugin name="storage_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Storage"/>

app/code/Magento/CatalogUrlRewrite/etc/di.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
<argument name="urlFinder" xsi:type="object">Magento\CatalogUrlRewrite\Model\Storage\DbStorage</argument>
1717
</arguments>
1818
</type>
19+
<type name="Magento\Catalog\Model\Resource\Category">
20+
<plugin name="category_move_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Move"/>
21+
<plugin name="category_delete_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Remove"/>
22+
</type>
1923
</config>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
9+
<event name="catalog_category_prepare_save">
10+
<observer name="category_save_rewrites_history_setter" instance="Magento\CatalogUrlRewrite\Observer\CategorySaveRewritesHistorySetter" method="invoke"/>
11+
</event>
12+
<event name="catalog_category_save_after">
13+
<observer name="process_url_rewrite_saving" instance="Magento\CatalogUrlRewrite\Model\Category\Observer" method="processUrlRewriteSaving"/>
14+
</event>
15+
</config>

0 commit comments

Comments
 (0)