Skip to content

Commit b2649b3

Browse files
merge magento/2.4.0-develop into magento-tsg/2.4.0-develop-pr56
2 parents 222b3f3 + a1587ae commit b2649b3

File tree

28 files changed

+113
-84
lines changed

28 files changed

+113
-84
lines changed

app/code/Magento/Backend/Block/Widget/Button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ protected function _beforeToHtml()
162162
{
163163
parent::_beforeToHtml();
164164

165-
$buttonId = 'buttonId' .$this->random->getRandomString(32);
165+
$buttonId = 'buttonId' .$this->random->getRandomString(10);
166166
$this->setData('backend_button_widget_hook_id', $buttonId);
167167

168168
$afterHtml = $this->getAfterHtml();

app/code/Magento/Backend/Block/Widget/Button/SplitButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ private function identifyOption(array $option): string
243243
? $this->getId() .'-' .$option['id']
244244
: (isset($option['id_attribute']) ?
245245
$option['id_attribute']
246-
: $this->getId() .'-optId' .$this->random->getRandomString(32));
246+
: $this->getId() .'-optId' .$this->random->getRandomString(10));
247247
}
248248

249249
/**

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected function _toLinkHtml($action, \Magento\Framework\DataObject $row)
132132
}
133133

134134
if (empty($action['id'])) {
135-
$action['id'] = 'id' .$this->random->getRandomString(32);
135+
$action['id'] = 'id' .$this->random->getRandomString(10);
136136
}
137137
$actionAttributes->setData($action);
138138
$onclick = $actionAttributes->getData('onclick');

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function renderHeader()
176176
if ($this->getColumn()->getDisabled()) {
177177
$disabled = ' disabled="disabled"';
178178
}
179-
$id = 'id' .$this->random->getRandomString(32);
179+
$id = 'id' .$this->random->getRandomString(10);
180180
$html = '<th class="data-grid-th data-grid-actions-cell"><input type="checkbox" ';
181181
$html .= 'id="' .$id .'" ';
182182
$html .= 'name="' . $this->getColumn()->getFieldName() . '" ';

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,18 @@
1313
"window.productConfigure && productConfigure.onLoadIFrame()",
1414
'iframe[name=\'product_composite_configure_iframe\']:last-of-type'
1515
) ?>
16-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
17-
"width:0; height:0; border:0px solid #fff; position:absolute; top:-1000px; left:-1000px",
18-
'iframe[name=\'product_composite_configure_iframe\']:last-of-type'
19-
) ?>
2016

2117
<form action="" method="post" id="product_composite_configure_form" enctype="multipart/form-data"
2218
target="product_composite_configure_iframe" class="product_composite_configure_form">
2319
<div class="entry-edit">
2420
<div id="product_composite_configure_messages" class="product_composite_configure_messages">
2521
<div class="messages"><div class="message message-error error"><div></div></div></div>
2622
</div>
27-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
28-
'display:none;',
29-
'.product_composite_configure_messages:last-of-type'
30-
) ?>
3123
<div id="product_composite_configure_form_fields" class="content product-composite-configure-inner"></div>
3224
<div id="product_composite_configure_form_additional" class="product_composite_configure_form_additional">
3325
</div>
34-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
35-
'display:none;',
36-
'.product_composite_configure_form_additional:last-of-type'
37-
) ?>
38-
<div id="product_composite_configure_form_confirmed" class="product_composite_configure_form_confirmed"></div>
39-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
40-
'display:none;',
41-
'.product_composite_configure_form_confirmed:last-of-type'
42-
) ?>
26+
<div id="product_composite_configure_form_confirmed" class="product_composite_configure_form_confirmed">
27+
</div>
4328
</div>
4429
<input type="hidden" name="as_js_varname" value="iFrameResponse" />
4530
<input type="hidden" name="form_key" value="<?= $block->escapeHtmlAttr($block->getFormKey()) ?>" />
@@ -51,12 +36,36 @@
5136
) ?>
5237

5338
<div id="product_composite_configure_confirmed" class="product_composite_configure_confirmed"></div>
54-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
55-
'display:none;',
56-
'.product_composite_configure_confirmed:last-of-type'
57-
) ?>
5839

5940
<?php $scriptString = <<<script
41+
prodCompConfIframe = document.querySelector("iframe[name='product_composite_configure_iframe']:last-of-type");
42+
prodCompConfIframe.style.width = 0;
43+
prodCompConfIframe.style.height = 0;
44+
prodCompConfIframe.style.border = "0px solid #fff";
45+
prodCompConfIframe.style.position = "absolute";
46+
prodCompConfIframe.style.top = "-1000px";
47+
prodCompConfIframe.style.left = "-1000px";
48+
prodCompConfMessages = document.querySelectorAll(".product_composite_configure_messages");
49+
for (var i = 0; i < prodCompConfMessages.length; i++) {
50+
prodCompConfMessages[i].style.display = "none";
51+
}
52+
prodCompConfFormAdd = document.querySelectorAll(".product_composite_configure_form_additional");
53+
for (var i = 0; i < prodCompConfFormAdd.length; i++) {
54+
prodCompConfFormAdd[i].style.display = "none";
55+
}
56+
prodCompConfFormConf = document.querySelectorAll(".product_composite_configure_form_confirmed");
57+
for (var i = 0; i < prodCompConfFormConf.length; i++) {
58+
prodCompConfFormConf[i].style.display = "none";
59+
}
60+
prodCompConfConf = document.querySelectorAll(".product_composite_configure_confirmed");
61+
for (var i = 0; i < prodCompConfConf.length; i++) {
62+
prodCompConfConf[i].style.display = "none";
63+
}
64+
prodConfPopup = document.querySelectorAll(".product-configure-popup");
65+
for (var i = 0; i < prodConfPopup.length; i++) {
66+
prodConfPopup[i].style.display = "none";
67+
}
68+
6069
require([
6170
"jquery",
6271
"mage/mage"
@@ -69,8 +78,3 @@ script;
6978
?>
7079
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
7180
</div>
72-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
73-
'display:none',
74-
'.product-configure-popup:last-of-type'
75-
) ?>
76-

app/code/Magento/Config/Block/System/Config/Form/Fieldset.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ protected function _getHeaderTitleHtml($element)
175175
'-link">' . $element->getLegend() . '</a>' .
176176
/* @noEscape */ $this->secureRenderer->renderEventListenerAsTag(
177177
'onclick',
178+
'event.preventDefault();' .
178179
"Fieldset.toggleCollapse('" . $element->getHtmlId() . "', '" .
179180
$this->_urlBuilder->getUrl('*/*/state') . "'); return false;",
180181
'a#' . $element->getHtmlId() . '-head'
@@ -225,7 +226,7 @@ protected function _getFooterHtml($element)
225226
);
226227
$html .= $this->secureRenderer->renderStyleAsTag(
227228
'display:none;',
228-
'row_' . $field->getId() . '_comment'
229+
'#row_' . $field->getId() . '_comment'
229230
);
230231
}
231232
}

app/code/Magento/Config/Test/Unit/Block/System/Config/Form/FieldsetTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public function testRenderWithStoredElements($expanded, $nested, $extra)
243243
$this->assertStringContainsString('test_field_toHTML', $actual);
244244

245245
$expected = '<div id="row_test_field_id_comment" class="system-tooltip-box">test_field_tootip</div>' .
246-
'<style>row_test_field_id_comment { display:none; }</style>';
246+
'<style>#row_test_field_id_comment { display:none; }</style>';
247247
$this->assertStringContainsString($expected, $actual);
248248
if ($nested) {
249249
$this->assertStringContainsString('nested', $actual);

app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Region.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
7474
'" class="select required-entry admin__control-select">';
7575
$html .= '<option value="">' . __('Please select') . '</option>';
7676
$html .= '</select>';
77-
$html .= $this->secureRenderer->renderStyleAsTag("display:none", '#region');
7877

79-
$scriptString = "\n";
78+
$scriptString = "\ndocument.querySelector('#$selectId').style.display = 'none';\n";
8079
$scriptString .= 'require(["prototype", "mage/adminhtml/form"], function(){';
8180
$scriptString .= '$("' . $selectId . '").setAttribute("defaultValue", "' . $regionId . '");' . "\n";
8281
$scriptString .= 'new regionUpdater("' .

app/code/Magento/Customer/Block/Adminhtml/Grid/Renderer/Multiaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function _toLinkHtml($action, \Magento\Framework\DataObject $row)
8585

8686
if (isset($action['process']) && $action['process'] == 'configurable') {
8787
if ($product->canConfigure()) {
88-
$id = 'id' .$this->random->getRandomString(32);
88+
$id = 'id' .$this->random->getRandomString(10);
8989
$onClick = sprintf('return %s.configureItem(%s)', $action['control_object'], $row->getId());
9090
return sprintf(
9191
'<a href="%s" id="%s" class="configure-item-link">%s</a>%s',

app/code/Magento/Customer/view/frontend/templates/account/authentication-popup.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/** @var \Magento\Customer\Block\Account\AuthenticationPopup $block */
88
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
99
?>
10-
<div id="authenticationPopup" data-bind="scope:'authenticationPopup'">
10+
<div id="authenticationPopup" data-bind="scope:'authenticationPopup', style: {display: 'none'}">
1111
<?php $scriptString = 'window.authenticationPopup = ' . /* @noEscape */ $block->getSerializedConfig(); ?>
1212
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>;
1313
<!-- ko template: getTemplate() --><!-- /ko -->
@@ -24,4 +24,3 @@
2424
}
2525
</script>
2626
</div>
27-
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag('display:none', '#authenticationPopup'); ?>

0 commit comments

Comments
 (0)