Skip to content

Commit bdff263

Browse files
Merge pull request #3375 from magento-qwerty/2.2.7-bugfixes-251018
Fixed issues: - MAGETWO-92172: [Backport for 2.2.x] Redundant File Names for Quote Attachments - MAGETWO-92725: Incorrect group actions behavior - MAGETWO-92181: Fixed incorrect behavior of attribute sets - MAGETWO-92184: JS Templates Limitations
2 parents 991d785 + bf9b3c0 commit bdff263

File tree

9 files changed

+94
-8
lines changed

9 files changed

+94
-8
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,37 @@
187187
if( config[i].children ) {
188188
for( j in config[i].children ) {
189189
if(config[i].children[j].id) {
190+
190191
newNode = new Ext.tree.TreeNode(config[i].children[j]);
192+
193+
if (typeof newNode.ui.onTextChange === 'function') {
194+
newNode.ui.onTextChange = function (_3, _4, _5) {
195+
if (this.rendered) {
196+
this.textNode.innerText = _4;
197+
}
198+
}
199+
}
200+
}
191201
node.appendChild(newNode);
192202
newNode.addListener('click', editSet.unregister);
193203
}
194204
}
195205
}
196206
}
197207
}
198-
}
208+
199209

200210
editSet = function() {
201211
return {
202212
register : function(node) {
203213
editSet.currentNode = node;
214+
if (typeof node.ui.onTextChange === 'function') {
215+
node.ui.onTextChange = function (_3, _4, _5) {
216+
if (this.rendered) {
217+
this.textNode.innerText = _4;
218+
}
219+
}
220+
}
204221
},
205222

206223
unregister : function() {
@@ -293,6 +310,14 @@
293310
allowDrag : true
294311
});
295312

313+
if (typeof newNode.ui.onTextChange === 'function') {
314+
newNode.ui.onTextChange = function (_3, _4, _5) {
315+
if (this.rendered) {
316+
this.textNode.innerText = _4;
317+
}
318+
}
319+
}
320+
296321
TreePanels.root.appendChild(newNode);
297322
newNode.addListener('beforemove', editSet.groupBeforeMove);
298323
newNode.addListener('beforeinsert', editSet.groupBeforeInsert);

app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ define([
3333
listens: {
3434
email: 'emailHasChanged',
3535
emailFocused: 'validateEmail'
36+
},
37+
ignoreTmpls: {
38+
email: true
3639
}
3740
},
3841
checkDelay: 2000,

app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public function __construct(
5757
* Update Save and Delete buttons. Remove Delete button if group can't be deleted.
5858
*
5959
* @return void
60+
* @throws \Magento\Framework\Exception\LocalizedException
61+
* @throws \Magento\Framework\Exception\NoSuchEntityException
6062
*/
6163
protected function _construct()
6264
{
@@ -68,6 +70,23 @@ protected function _construct()
6870

6971
$this->buttonList->update('save', 'label', __('Save Customer Group'));
7072
$this->buttonList->update('delete', 'label', __('Delete Customer Group'));
73+
$this->buttonList->update(
74+
'delete',
75+
'onclick',
76+
sprintf(
77+
"deleteConfirm('%s','%s', %s)",
78+
'Are you sure?',
79+
$this->getDeleteUrl(),
80+
json_encode(
81+
[
82+
'action' => '',
83+
'data' => [
84+
'form_key' => $this->getFormKey()
85+
]
86+
]
87+
)
88+
)
89+
);
7190

7291
$groupId = $this->coreRegistry->registry(RegistryConstants::CURRENT_GROUP_ID);
7392
if (!$groupId || $this->groupManagement->isReadonly($groupId)) {

app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@
77
namespace Magento\Customer\Controller\Adminhtml\Group;
88

99
use Magento\Framework\Exception\NoSuchEntityException;
10+
use Magento\Framework\Exception\NotFoundException;
1011

1112
class Delete extends \Magento\Customer\Controller\Adminhtml\Group
1213
{
1314
/**
1415
* Delete customer group.
1516
*
1617
* @return \Magento\Backend\Model\View\Result\Redirect
18+
* @throws NotFoundException
1719
*/
1820
public function execute()
1921
{
22+
if (!$this->getRequest()->isPost()) {
23+
throw new NotFoundException(__('Page not found'));
24+
}
25+
2026
$id = $this->getRequest()->getParam('id');
2127
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
2228
$resultRedirect = $this->resultRedirectFactory->create();

app/code/Magento/Ui/view/base/web/js/form/element/abstract.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ define([
5757
'${ $.provider }:${ $.customScope ? $.customScope + "." : ""}data.validate': 'validate',
5858
'isUseDefault': 'toggleUseDefault'
5959
},
60+
ignoreTmpls: {
61+
value: true
62+
},
6063

6164
links: {
6265
value: '${ $.provider }:${ $.dataScope }'

app/code/Magento/Ui/view/base/web/js/grid/editing/record.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ define([
5050
}
5151
}
5252
},
53+
ignoreTmpls: {
54+
data: true
55+
},
5356
listens: {
5457
elems: 'updateFields',
5558
data: 'updateState'

dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\Message\MessageInterface;
99
use Magento\TestFramework\Helper\Bootstrap;
10+
use Magento\Framework\Data\Form\FormKey;
1011

1112
/**
1213
* @magentoAppArea adminhtml
@@ -80,6 +81,11 @@ public function testNewActionWithCustomerGroupDataInSession()
8081
*/
8182
public function testDeleteActionNoGroupId()
8283
{
84+
/** @var FormKey $formKey */
85+
$formKey = $this->_objectManager->get(FormKey::class);
86+
87+
$this->getRequest()->setMethod('POST');
88+
$this->getRequest()->setParam('form_key', $formKey->getFormKey());
8389
$this->dispatch('backend/customer/group/delete');
8490
$this->assertRedirect($this->stringStartsWith(self::BASE_CONTROLLER_URL));
8591
}
@@ -90,7 +96,17 @@ public function testDeleteActionNoGroupId()
9096
public function testDeleteActionExistingGroup()
9197
{
9298
$groupId = $this->findGroupIdWithCode(self::CUSTOMER_GROUP_CODE);
93-
$this->getRequest()->setParam('id', $groupId);
99+
100+
/** @var FormKey $formKey */
101+
$formKey = $this->_objectManager->get(FormKey::class);
102+
103+
$this->getRequest()->setMethod('POST');
104+
$this->getRequest()->setParams(
105+
[
106+
'id' => $groupId,
107+
'form_key' => $formKey->getFormKey()
108+
]
109+
);
94110
$this->dispatch('backend/customer/group/delete');
95111

96112
/**
@@ -108,7 +124,16 @@ public function testDeleteActionExistingGroup()
108124
*/
109125
public function testDeleteActionNonExistingGroupId()
110126
{
111-
$this->getRequest()->setParam('id', 10000);
127+
/** @var FormKey $formKey */
128+
$formKey = $this->_objectManager->get(FormKey::class);
129+
130+
$this->getRequest()->setMethod('POST');
131+
$this->getRequest()->setParams(
132+
[
133+
'id' => 10000,
134+
'form_key' => $formKey->getFormKey()
135+
]
136+
);
112137
$this->dispatch('backend/customer/group/delete');
113138

114139
/**

lib/internal/Magento/Framework/File/Uploader.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,22 @@ public function save($destinationFolder, $newFileName = null)
210210
$this->_result = false;
211211
$destinationFile = $destinationFolder;
212212
$fileName = isset($newFileName) ? $newFileName : $this->_file['name'];
213-
$fileName = self::getCorrectFileName($fileName);
213+
$fileName = static::getCorrectFileName($fileName);
214214
if ($this->_enableFilesDispersion) {
215215
$fileName = $this->correctFileNameCase($fileName);
216216
$this->setAllowCreateFolders(true);
217-
$this->_dispretionPath = self::getDispersionPath($fileName);
217+
$this->_dispretionPath = static::getDispersionPath($fileName);
218218
$destinationFile .= $this->_dispretionPath;
219219
$this->_createDestinationFolder($destinationFile);
220220
}
221221

222222
if ($this->_allowRenameFiles) {
223-
$fileName = self::getNewFileName(self::_addDirSeparator($destinationFile) . $fileName);
223+
$fileName = static::getNewFileName(
224+
static::_addDirSeparator($destinationFile) . $fileName
225+
);
224226
}
225227

226-
$destinationFile = self::_addDirSeparator($destinationFile) . $fileName;
228+
$destinationFile = static::_addDirSeparator($destinationFile) . $fileName;
227229

228230
try {
229231
$this->_result = $this->_moveFile($this->_file['tmp_name'], $destinationFile);

nginx.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ location /media/import/ {
166166
}
167167

168168
# PHP entry point for main application
169-
location ~ (index|get|static|report|404|503|health_check)\.php$ {
169+
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ {
170170
try_files $uri =404;
171171
fastcgi_pass fastcgi_backend;
172172
fastcgi_buffers 1024 4k;

0 commit comments

Comments
 (0)