Skip to content

Commit

Permalink
Merge pull request #3375 from magento-qwerty/2.2.7-bugfixes-251018
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dvoskoboinikov authored Oct 29, 2018
2 parents 991d785 + bf9b3c0 commit bdff263
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,37 @@
if( config[i].children ) {
for( j in config[i].children ) {
if(config[i].children[j].id) {

newNode = new Ext.tree.TreeNode(config[i].children[j]);

if (typeof newNode.ui.onTextChange === 'function') {
newNode.ui.onTextChange = function (_3, _4, _5) {
if (this.rendered) {
this.textNode.innerText = _4;
}
}
}
}
node.appendChild(newNode);
newNode.addListener('click', editSet.unregister);
}
}
}
}
}
}


editSet = function() {
return {
register : function(node) {
editSet.currentNode = node;
if (typeof node.ui.onTextChange === 'function') {
node.ui.onTextChange = function (_3, _4, _5) {
if (this.rendered) {
this.textNode.innerText = _4;
}
}
}
},

unregister : function() {
Expand Down Expand Up @@ -293,6 +310,14 @@
allowDrag : true
});

if (typeof newNode.ui.onTextChange === 'function') {
newNode.ui.onTextChange = function (_3, _4, _5) {
if (this.rendered) {
this.textNode.innerText = _4;
}
}
}

TreePanels.root.appendChild(newNode);
newNode.addListener('beforemove', editSet.groupBeforeMove);
newNode.addListener('beforeinsert', editSet.groupBeforeInsert);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ define([
listens: {
email: 'emailHasChanged',
emailFocused: 'validateEmail'
},
ignoreTmpls: {
email: true
}
},
checkDelay: 2000,
Expand Down
19 changes: 19 additions & 0 deletions app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function __construct(
* Update Save and Delete buttons. Remove Delete button if group can't be deleted.
*
* @return void
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function _construct()
{
Expand All @@ -68,6 +70,23 @@ protected function _construct()

$this->buttonList->update('save', 'label', __('Save Customer Group'));
$this->buttonList->update('delete', 'label', __('Delete Customer Group'));
$this->buttonList->update(
'delete',
'onclick',
sprintf(
"deleteConfirm('%s','%s', %s)",
'Are you sure?',
$this->getDeleteUrl(),
json_encode(
[
'action' => '',
'data' => [
'form_key' => $this->getFormKey()
]
]
)
)
);

$groupId = $this->coreRegistry->registry(RegistryConstants::CURRENT_GROUP_ID);
if (!$groupId || $this->groupManagement->isReadonly($groupId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@
namespace Magento\Customer\Controller\Adminhtml\Group;

use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\NotFoundException;

class Delete extends \Magento\Customer\Controller\Adminhtml\Group
{
/**
* Delete customer group.
*
* @return \Magento\Backend\Model\View\Result\Redirect
* @throws NotFoundException
*/
public function execute()
{
if (!$this->getRequest()->isPost()) {
throw new NotFoundException(__('Page not found'));
}

$id = $this->getRequest()->getParam('id');
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultRedirectFactory->create();
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ define([
'${ $.provider }:${ $.customScope ? $.customScope + "." : ""}data.validate': 'validate',
'isUseDefault': 'toggleUseDefault'
},
ignoreTmpls: {
value: true
},

links: {
value: '${ $.provider }:${ $.dataScope }'
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Ui/view/base/web/js/grid/editing/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ define([
}
}
},
ignoreTmpls: {
data: true
},
listens: {
elems: 'updateFields',
data: 'updateState'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Magento\Framework\Message\MessageInterface;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Framework\Data\Form\FormKey;

/**
* @magentoAppArea adminhtml
Expand Down Expand Up @@ -80,6 +81,11 @@ public function testNewActionWithCustomerGroupDataInSession()
*/
public function testDeleteActionNoGroupId()
{
/** @var FormKey $formKey */
$formKey = $this->_objectManager->get(FormKey::class);

$this->getRequest()->setMethod('POST');
$this->getRequest()->setParam('form_key', $formKey->getFormKey());
$this->dispatch('backend/customer/group/delete');
$this->assertRedirect($this->stringStartsWith(self::BASE_CONTROLLER_URL));
}
Expand All @@ -90,7 +96,17 @@ public function testDeleteActionNoGroupId()
public function testDeleteActionExistingGroup()
{
$groupId = $this->findGroupIdWithCode(self::CUSTOMER_GROUP_CODE);
$this->getRequest()->setParam('id', $groupId);

/** @var FormKey $formKey */
$formKey = $this->_objectManager->get(FormKey::class);

$this->getRequest()->setMethod('POST');
$this->getRequest()->setParams(
[
'id' => $groupId,
'form_key' => $formKey->getFormKey()
]
);
$this->dispatch('backend/customer/group/delete');

/**
Expand All @@ -108,7 +124,16 @@ public function testDeleteActionExistingGroup()
*/
public function testDeleteActionNonExistingGroupId()
{
$this->getRequest()->setParam('id', 10000);
/** @var FormKey $formKey */
$formKey = $this->_objectManager->get(FormKey::class);

$this->getRequest()->setMethod('POST');
$this->getRequest()->setParams(
[
'id' => 10000,
'form_key' => $formKey->getFormKey()
]
);
$this->dispatch('backend/customer/group/delete');

/**
Expand Down
10 changes: 6 additions & 4 deletions lib/internal/Magento/Framework/File/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,22 @@ public function save($destinationFolder, $newFileName = null)
$this->_result = false;
$destinationFile = $destinationFolder;
$fileName = isset($newFileName) ? $newFileName : $this->_file['name'];
$fileName = self::getCorrectFileName($fileName);
$fileName = static::getCorrectFileName($fileName);
if ($this->_enableFilesDispersion) {
$fileName = $this->correctFileNameCase($fileName);
$this->setAllowCreateFolders(true);
$this->_dispretionPath = self::getDispersionPath($fileName);
$this->_dispretionPath = static::getDispersionPath($fileName);
$destinationFile .= $this->_dispretionPath;
$this->_createDestinationFolder($destinationFile);
}

if ($this->_allowRenameFiles) {
$fileName = self::getNewFileName(self::_addDirSeparator($destinationFile) . $fileName);
$fileName = static::getNewFileName(
static::_addDirSeparator($destinationFile) . $fileName
);
}

$destinationFile = self::_addDirSeparator($destinationFile) . $fileName;
$destinationFile = static::_addDirSeparator($destinationFile) . $fileName;

try {
$this->_result = $this->_moveFile($this->_file['tmp_name'], $destinationFile);
Expand Down
2 changes: 1 addition & 1 deletion nginx.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ location /media/import/ {
}

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

0 comments on commit bdff263

Please sign in to comment.