Skip to content

Commit aa55542

Browse files
committed
MAGETWO-57461: [Backport] - Exception occurs when tracking shipment with invalid FedEx tracking number - for 2.0.x
2 parents dc9c4e2 + 368f241 commit aa55542

File tree

34 files changed

+1099
-42
lines changed

34 files changed

+1099
-42
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function execute()
132132
$attributesData[$attributeCode] = $value;
133133
} elseif ($attribute->getFrontendInput() == 'multiselect') {
134134
// Check if 'Change' checkbox has been checked by admin for this attribute
135-
$isChanged = (bool)$this->getRequest()->getPost($attributeCode . '_checkbox');
135+
$isChanged = (bool)$this->getRequest()->getPost('toggle_' . $attributeCode);
136136
if (!$isChanged) {
137137
unset($attributesData[$attributeCode]);
138138
continue;

app/code/Magento/Sales/view/frontend/templates/order/history.phtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
<span><?php /* @escapeNotVerified */ echo __('View Order') ?></span>
3737
</a>
3838
<?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
39-
<a href="<?php /* @escapeNotVerified */ echo $block->getReorderUrl($_order) ?>" class="action order">
39+
<a href="#" data-post='<?php /* @escapeNotVerified */ echo
40+
$this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
41+
->getPostData($block->getReorderUrl($_order))
42+
?>' class="action order">
4043
<span><?php /* @escapeNotVerified */ echo __('Reorder') ?></span>
4144
</a>
4245
<?php endif ?>

app/code/Magento/Sales/view/frontend/templates/order/info/buttons.phtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<div class="actions">
1111
<?php $_order = $block->getOrder() ?>
1212
<?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
13-
<a class="action reorder" href="<?php /* @escapeNotVerified */ echo $block->getReorderUrl($_order) ?>">
13+
<a href="#" data-post='<?php /* @escapeNotVerified */ echo
14+
$this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
15+
->getPostData($block->getReorderUrl($_order))
16+
?>' class="action order">
1417
<span><?php /* @escapeNotVerified */ echo __('Reorder') ?></span>
1518
</a>
1619
<?php endif ?>

app/code/Magento/Sales/view/frontend/templates/order/recent.phtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@
4646
<span><?php /* @escapeNotVerified */ echo __('View Order') ?></span>
4747
</a>
4848
<?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
49-
<a href="<?php /* @escapeNotVerified */ echo $block->getReorderUrl($_order) ?>" class="action order">
49+
<a href="#" data-post='<?php /* @escapeNotVerified */ echo
50+
$this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
51+
->getPostData($block->getReorderUrl($_order))
52+
?>' class="action order">
5053
<span><?php /* @escapeNotVerified */ echo __('Reorder') ?></span>
5154
</a>
5255
<?php endif ?>

app/code/Magento/User/Block/User/Edit.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,25 @@ protected function _construct()
4848
parent::_construct();
4949

5050
$this->buttonList->update('save', 'label', __('Save User'));
51-
$this->buttonList->update('delete', 'label', __('Delete User'));
51+
$this->buttonList->remove('delete');
5252

5353
$objId = $this->getRequest()->getParam($this->_objectId);
5454

5555
if (!empty($objId)) {
56+
$this->addButton(
57+
'delete',
58+
[
59+
'label' => __('Delete User'),
60+
'class' => 'delete',
61+
'onclick' => sprintf(
62+
'deleteConfirm("%s", "%s", %s)',
63+
__('Are you sure you want to do this?'),
64+
$this->getUrl('adminhtml/*/delete'),
65+
json_encode(['data' => ['user_id' => $objId]])
66+
),
67+
]
68+
);
69+
5670
$deleteConfirmMsg = __("Are you sure you want to revoke the user\'s tokens?");
5771
$this->addButton(
5872
'invalidate',

app/code/Magento/User/Controller/Adminhtml/User/Delete.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class Delete extends \Magento\User\Controller\Adminhtml\User
1313
*/
1414
public function execute()
1515
{
16-
$currentUser = $this->_objectManager->get('Magento\Backend\Model\Auth\Session')->getUser();
16+
$currentUser = $this->_objectManager->get(\Magento\Backend\Model\Auth\Session::class)->getUser();
1717

18-
if ($userId = $this->getRequest()->getParam('user_id')) {
18+
if ($userId = (int)$this->getRequest()->getPost('user_id')) {
1919
if ($currentUser->getId() == $userId) {
2020
$this->messageManager->addError(__('You cannot delete your own account.'));
2121
$this->_redirect('adminhtml/*/edit', ['user_id' => $userId]);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Client\Element;
8+
9+
use Magento\Mtf\Client\Locator;
10+
11+
/**
12+
* Custom checkbox that hidden by label
13+
*/
14+
class CheckboxwithlabelElement extends CheckboxElement
15+
{
16+
/**
17+
* Set checkbox value by clicking on label
18+
*
19+
* @param string $value
20+
*/
21+
public function setValue($value)
22+
{
23+
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
24+
if (($this->isSelected() && $value == 'No') || (!$this->isSelected() && $value == 'Yes')) {
25+
$this->find('./following-sibling::label', Locator::SELECTOR_XPATH)->click();
26+
}
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Backend\Test\Block;
8+
9+
use Magento\Mtf\Block\Block;
10+
use Magento\Mtf\Client\Locator;
11+
12+
class Version extends Block
13+
{
14+
/**
15+
* @var string
16+
*/
17+
protected $backendVersion = 'magento-version';
18+
19+
/**
20+
* Returns dashboard application version
21+
*
22+
* @return string
23+
*/
24+
public function getVersion()
25+
{
26+
return $this->_rootElement->find($this->backendVersion, Locator::SELECTOR_CLASS_NAME)->getText();
27+
}
28+
}

dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<block name="errorBlock" class="Magento\Backend\Test\Block\Page\Error" locator="[id='page:main-container']" strategy="css selector" />
1616
<block name="accessDeniedBlock" class="Magento\Backend\Test\Block\Denied" locator="#anchor-content" strategy="css selector" />
1717
<block name="systemMessageDialog" class="Magento\AdminNotification\Test\Block\System\Messages" locator='[role="dialog"].ui-popup-message' strategy="css selector" />
18+
<block name="applicationVersion" class="Magento\Backend\Test\Block\Version" locator="body" strategy="css selector" />
1819
</page>
1920
</config>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Upgrade\Test\Block;
8+
9+
use Magento\Mtf\Block\Form;
10+
use Magento\Mtf\Client\Element\SimpleElement;
11+
use Magento\Mtf\Client\Locator;
12+
use Magento\Mtf\Fixture\FixtureInterface;
13+
14+
/**
15+
* Perform Authentication block.
16+
*/
17+
class Authentication extends Form
18+
{
19+
/**
20+
* 'Save Config' button.
21+
*
22+
* @var string
23+
*/
24+
protected $save = "[ng-click*='saveAuthJson']";
25+
26+
/**
27+
* First field selector
28+
*
29+
* @var string
30+
*/
31+
protected $firstField = '[name="username"]';
32+
33+
/**
34+
* Click on 'Save Config' button.
35+
*
36+
* @return void
37+
*/
38+
public function clickSaveConfig()
39+
{
40+
$this->_rootElement->find($this->save, Locator::SELECTOR_CSS)->click();
41+
}
42+
43+
/**
44+
* Ensure the form is loaded and fill the root form
45+
*
46+
* @param FixtureInterface $fixture
47+
* @param SimpleElement|null $element
48+
* @return $this
49+
*/
50+
public function fill(FixtureInterface $fixture, SimpleElement $element = null)
51+
{
52+
$this->waitForElementVisible($this->firstField);
53+
return parent::fill($fixture, $element);
54+
}
55+
}

0 commit comments

Comments
 (0)