Skip to content

Commit a318778

Browse files
committed
Merge branch '2.2-develop' into MC-16764
2 parents 187f645 + 3c6ab2e commit a318778

File tree

191 files changed

+2518
-2567
lines changed

Some content is hidden

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

191 files changed

+2518
-2567
lines changed

app/code/Magento/Backend/Test/Mftf/ActionGroup/LoginAsAdminActionGroup.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="LoginAsAdmin">
1212
<arguments>
13-
<argument name="adminUser" defaultValue="_ENV"/>
13+
<argument name="adminUser" defaultValue="DefaultAdminUser"/>
1414
</arguments>
1515
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
16-
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{adminUser.MAGENTO_ADMIN_USERNAME}}" stepKey="fillUsername"/>
17-
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{adminUser.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
16+
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{adminUser.username}}" stepKey="fillUsername"/>
17+
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{adminUser.password}}" stepKey="fillPassword"/>
1818
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/>
1919
<closeAdminNotification stepKey="closeAdminNotification"/>
2020
</actionGroup>

app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Extend */
108
$elementHtml = $block->getParentElementHtml();
119

12-
$attributeCode = $block->getAttribute()
13-
->getAttributeCode();
10+
$attributeCode = $block->getAttribute()->getAttributeCode();
1411

1512
$switchAttributeCode = "{$attributeCode}_type";
1613
$switchAttributeValue = $block->getProduct()
@@ -21,17 +18,17 @@ $isElementReadonly = $block->getElement()
2118
?>
2219

2320
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)) { ?>
24-
<div class="<?= /* @escapeNotVerified */ $attributeCode ?> "><?= /* @escapeNotVerified */ $elementHtml ?></div>
21+
<div class="<?= $block->escapeHtmlAttr($attributeCode) ?> "><?= /* @noEscape */ $elementHtml ?></div>
2522
<?php } ?>
2623

2724
<?= $block->getExtendedElement($switchAttributeCode)->toHtml() ?>
2825

2926
<?php if (!$isElementReadonly && $block->getDisableChild()) { ?>
3027
<script>
3128
require(['prototype'], function () {
32-
function <?= /* @escapeNotVerified */ $switchAttributeCode ?>_change() {
33-
var $attribute = $('<?= /* @escapeNotVerified */ $attributeCode ?>');
34-
if ($('<?= /* @escapeNotVerified */ $switchAttributeCode ?>').value == '<?= /* @escapeNotVerified */ $block::DYNAMIC ?>') {
29+
function <?= $block->escapeJs($switchAttributeCode) ?>_change() {
30+
var $attribute = $('<?= /* @noEscape */ $attributeCode ?>');
31+
if ($('<?= $block->escapeJs($switchAttributeCode) ?>').value == '<?= $block->escapeJs($block::DYNAMIC) ?>') {
3532
if ($attribute) {
3633
$attribute.disabled = true;
3734
$attribute.value = '';
@@ -44,8 +41,8 @@ $isElementReadonly = $block->getElement()
4441
if ($attribute) {
4542
<?php if ($attributeCode === 'price' && !$block->getCanEditPrice() && $block->getCanReadPrice()
4643
&& $block->getProduct()->isObjectNew()) { ?>
47-
<?php $defaultProductPrice = $block->getDefaultProductPrice() ?: "''"; ?>
48-
$attribute.value = <?= /* @escapeNotVerified */ $defaultProductPrice ?>;
44+
<?php $defaultProductPrice = $block->escapeJs($block->getDefaultProductPrice() ?: "''") ?>
45+
$attribute.value = <?= $block->escapeJs($defaultProductPrice) ?>;
4946
<?php } else { ?>
5047
$attribute.disabled = false;
5148
$attribute.addClassName('required-entry');
@@ -59,10 +56,10 @@ $isElementReadonly = $block->getElement()
5956

6057
<?php if (!($attributeCode === 'price' && !$block->getCanEditPrice()
6158
&& !$block->getProduct()->isObjectNew())) { ?>
62-
$('<?= /* @escapeNotVerified */ $switchAttributeCode ?>').observe('change', <?= /* @escapeNotVerified */ $switchAttributeCode ?>_change);
59+
$('<?= $block->escapeJs($switchAttributeCode) ?>').observe('change', <?= $block->escapeJs($switchAttributeCode) ?>_change);
6360
<?php } ?>
6461
Event.observe(window, 'load', function(){
65-
<?= /* @escapeNotVerified */ $switchAttributeCode ?>_change();
62+
<?= $block->escapeJs($switchAttributeCode) ?>_change();
6663
});
6764
});
6865
</script>

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/bundle.phtml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107

118
<?php /* @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Bundle */ ?>
129
<?php $options = $block->decorateArray($block->getOptions(true)); ?>
13-
<?php if (count($options)): ?>
10+
<?php if (count($options)) : ?>
1411
<fieldset id="catalog_product_composite_configure_fields_bundle"
1512
class="fieldset admin__fieldset composite-bundle<?= $block->getIsLastFieldset() ? ' last-fieldset' : '' ?>">
16-
<legend class="legend admin__legend"><span><?= /* @escapeNotVerified */ __('Bundle Items') ?></span></legend><br />
13+
<legend class="legend admin__legend"><span><?= $block->escapeHtml(__('Bundle Items')) ?></span></legend><br />
1714
<?php foreach ($options as $option) : ?>
1815
<?php if ($option->getSelections()) : ?>
1916
<?= $block->getOptionHtml($option) ?>
@@ -71,7 +68,7 @@ require([
7168
}
7269
}
7370
};
74-
ProductConfigure.bundleControl = new BundleControl(<?= /* @escapeNotVerified */ $block->getJsonConfig() ?>);
71+
ProductConfigure.bundleControl = new BundleControl(<?= /* @noEscape */ $block->getJsonConfig() ?>);
7572
});
7673
</script>
7774

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,57 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
6+
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
97
?>
108
<?php /* @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Checkbox */ ?>
119
<?php $_option = $block->getOption(); ?>
1210
<?php $_selections = $_option->getSelections(); ?>
13-
<?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?>
11+
<?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?>
1412

15-
<div class="field admin__field options<?php if ($_option->getRequired()) echo ' required _required' ?>">
13+
<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' required _required'; } ?>">
1614
<label class="label admin__field-label">
1715
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
1816
</label>
1917

2018
<div class="control admin__field-control">
21-
<div class="nested <?php if ($_option->getDecoratedIsLast()):?> last<?php endif;?>">
19+
<div class="nested <?php if ($_option->getDecoratedIsLast()) :?> last<?php endif;?>">
2220

23-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
24-
<?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
21+
<?php if (count($_selections) == 1 && $_option->getRequired()) : ?>
22+
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
2523
<input type="hidden"
26-
name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>]"
27-
value="<?= /* @escapeNotVerified */ $_selections[0]->getSelectionId() ?>"
28-
price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selections[0]) ?>" />
29-
<?php else:?>
30-
31-
<?php foreach ($_selections as $_selection): ?>
24+
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
25+
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"
26+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selections[0])) ?>" />
27+
<?php else :?>
28+
<?php foreach ($_selections as $_selection) : ?>
3229
<div class="field choice admin__field admin__field-option">
3330
<input
34-
class="change-container-classname admin__control-checkbox checkbox bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>"
35-
id="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>-<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>"
31+
class="change-container-classname admin__control-checkbox checkbox bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> <?php if ($_option->getRequired()) { echo 'validate-one-required-by-name'; } ?>"
32+
id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
3633
type="checkbox"
37-
name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>][<?= /* @escapeNotVerified */ $_selection->getId() ?>]"
38-
<?php if ($block->isSelected($_selection)):?>
34+
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
35+
<?php if ($block->isSelected($_selection)) :?>
3936
<?= ' checked="checked"' ?>
4037
<?php endif;?>
41-
<?php if (!$_selection->isSaleable() && !$_skipSaleableCheck):?>
38+
<?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) :?>
4239
<?= ' disabled="disabled"' ?>
4340
<?php endif;?>
44-
value="<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>"
41+
value="<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
4542
onclick="ProductConfigure.bundleControl.changeSelection(this)"
46-
price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selection) ?>" />
43+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selection)) ?>" />
4744

4845
<label class="admin__field-label"
49-
for="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>-<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>">
50-
<span><?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selection) ?></span>
46+
for="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>">
47+
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selection) ?></span>
5148
</label>
5249

53-
<?php if ($_option->getRequired()): ?>
54-
<?= /* @escapeNotVerified */ $block->setValidationContainer('bundle-option-' . $_option->getId() . '-' . $_selection->getSelectionId(), 'bundle-option-' . $_option->getId() . '-container') ?>
50+
<?php if ($_option->getRequired()) : ?>
51+
<?= /* @noEscape */ $block->setValidationContainer('bundle-option-' . $_option->getId() . '-' . $_selection->getSelectionId(), 'bundle-option-' . $_option->getId() . '-container') ?>
5552
<?php endif;?>
5653
</div>
5754
<?php endforeach; ?>
5855

59-
<div id="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>-container"></div>
56+
<div id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></div>
6057
<?php endif; ?>
6158
</div>
6259
</div>

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
6+
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
97
?>
108
<?php /* @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Multi */ ?>
119
<?php $_option = $block->getOption(); ?>
1210
<?php $_selections = $_option->getSelections(); ?>
13-
<?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?>
14-
<div class="field admin__field <?php if ($_option->getRequired()) echo ' required' ?><?php if ($_option->getDecoratedIsLast()):?> last<?php endif; ?>">
11+
<?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?>
12+
<div class="field admin__field <?php if ($_option->getRequired()) { echo ' required'; } ?><?php if ($_option->getDecoratedIsLast()) :?> last<?php endif; ?>">
1513
<label class="label admin__field-label"><span><?= $block->escapeHtml($_option->getTitle()) ?></span></label>
1614
<div class="control admin__field-control">
17-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
18-
<?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
19-
<input type="hidden" name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>]"
20-
value="<?= /* @escapeNotVerified */ $_selections[0]->getSelectionId() ?>"
21-
price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selections[0]) ?>" />
22-
<?php else: ?>
23-
<select multiple="multiple" size="5" id="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>"
24-
name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>][]"
25-
class="admin__control-multiselect bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> multiselect change-container-classname"
15+
<?php if (count($_selections) == 1 && $_option->getRequired()) : ?>
16+
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
17+
<input type="hidden" name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
18+
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"
19+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selections[0])) ?>" />
20+
<?php else : ?>
21+
<select multiple="multiple" size="5" id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>"
22+
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][]"
23+
class="admin__control-multiselect bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?><?php if ($_option->getRequired()) { echo ' required-entry'; } ?> multiselect change-container-classname"
2624
onchange="ProductConfigure.bundleControl.changeSelection(this)">
27-
<?php if(!$_option->getRequired()): ?>
28-
<option value=""><?= /* @escapeNotVerified */ __('None') ?></option>
25+
<?php if (!$_option->getRequired()) : ?>
26+
<option value=""><?= $block->escapeHtml(__('None')) ?></option>
2927
<?php endif; ?>
30-
<?php foreach ($_selections as $_selection): ?>
31-
<option value="<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>"<?php if ($block->isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selection) ?>"><?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selection, false) ?></option>
28+
<?php foreach ($_selections as $_selection) : ?>
29+
<option value="<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
30+
<?php if ($block->isSelected($_selection)) { echo ' selected="selected"'; } ?>
31+
<?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) { echo ' disabled="disabled"'; } ?>
32+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selection)) ?>">
33+
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selection, false) ?></option>
3234
<?php endforeach; ?>
3335
</select>
3436
<?php endif; ?>

0 commit comments

Comments
 (0)