Skip to content

Commit 5388ad0

Browse files
author
Momotenko,Natalia(nmomotenko)
committed
Merge pull request #322 from magento-sparta/MDVA-53_PART2
[Sparta] Bugs Patch 2.0.1 (Combined)
2 parents 8cc304a + bc35b71 commit 5388ad0

File tree

48 files changed

+816
-191
lines changed

Some content is hidden

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

48 files changed

+816
-191
lines changed

CHANGELOG.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,45 @@
1111
* Fixed a potential vulnerability on checkout page
1212
* Fixed an issue with upload empty file to custom option
1313
* Fixed an issue with performance on customer edit form
14+
* Fixed an issue where minicart does not clears after completing an order via PayPal
15+
* Fixed an potential XSS vulnerability
16+
* USPS January 17, 2016 API Changes
17+
* Fixed an issue plugin incorrect calls when proxy exists
18+
* Fixed an issue when travis CI builds fail due to authentication
19+
* Fixed an issue when custom options calculated incorrect for configurable products
20+
* Fixed an issue with changing category form on store view level
21+
* Updated composer version in braintree package
22+
* Fixed an issue where URL rewrites works incorrect for sample data
23+
* Fixed an issue with BaseURL in static files
24+
* Fixed an issue where customer custom attribute of 'file' type isn't supported by UI Form Component
25+
* Fixed an issue when bin/magento setup:upgrade does not clear cache properly
26+
* Fixed an issue where MessageBox plugin duplicating logic
27+
* Fixed an issue where unnecessary StoreCookie plugin is executed on each request
28+
* Fixed a potential security issue in input filter
29+
* Fixed an issue where category creation from product page fails if google experiments enabled
30+
* Fixed a potential security issue with frontend captcha
31+
* Fixed a potential security issue with block cache
32+
* Fixed an issue where information about selected country in address is not presented on checkout flow
33+
* Fixed an issue where customer segments prevent page from caching
34+
* Fixed an performance issue related to swatch module
35+
* Fixed an issue where import product with replace behaviour causes an error for multistore
36+
* Fixed an issue with validation of url_key during import
37+
* Fixed an issue with "Learn More" link for Payments Pro goes to Payflow Pro
38+
* Fixed an issue with JS error appears if loading product grid after clean cache and static files
39+
Tests:
40+
* Fixed an issue with test failure in testGetPackagesForUpdate
41+
* Fixed integration tests related to setup/upgrade functionality
42+
* Fixed an issue where PHP7 Integration test failed
43+
* Fixed an issue with autoload functionality for jmx-generator.php file
44+
* Fixed an issue with legacy tests
45+
* Fixed an issues in tests related to PHP7
1446
* GitHub requests:
1547
* [#2519](https://github.com/magento/magento2/issues/2519) -- Fixed an issue where synonyms don't work with Magento 2.0
16-
48+
* [#2675](https://github.com/magento/magento2/issues/2675) -- Fixed an issue with admin order creation when config "Include Tax In Order Total" set to yes
49+
* [#2471](https://github.com/magento/magento2/issues/2471) -- Fixed an issue with incorrect prices on configurable product page when catalog prices include tax
50+
* [#2674](https://github.com/magento/magento2/issues/2674) -- Fixed an issue where plugins/interceptors don't work with early stage single instance objects
51+
* [#2888](https://github.com/magento/magento2/issues/2888) -- Fixed an issue where not all files are pre-compiled
52+
1753
2.0.0
1854
=============
1955
* Fixed bugs:

app/code/Magento/Braintree/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"magento/module-directory": "100.0.*",
1717
"magento/module-theme": "100.0.*",
1818
"magento/framework": "100.0.*",
19-
"braintree/braintree_php": "2.39.0"
19+
"braintree/braintree_php": "3.7.0"
2020
},
2121
"suggest": {
2222
"magento/module-checkout-agreements": "100.0.*"

app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
namespace Magento\Catalog\Block\Adminhtml\Category\Tab;
1313

14-
class Attributes extends \Magento\Backend\Block\Widget\Form\Generic
14+
class Attributes extends \Magento\Catalog\Block\Adminhtml\Form
1515
{
1616
/**
1717
* Retrieve Category object

app/code/Magento/CatalogUrlRewrite/etc/adminhtml/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<plugin name="category_move_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Move"/>
1717
<plugin name="category_delete_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Remove"/>
1818
</type>
19-
<type name="Magento\UrlRewrite\Model\StorageInterface">
20-
<plugin name="storage_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Storage"/>
21-
</type>
2219
<type name="Magento\Catalog\Block\Adminhtml\Category\Tab\Attributes">
2320
<plugin name="category_form_url_key_plugin" type="Magento\CatalogUrlRewrite\Plugin\Catalog\Block\Adminhtml\Category\Tab\Attributes"/>
2421
</type>

app/code/Magento/CatalogUrlRewrite/etc/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@
2020
<plugin name="category_move_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Move"/>
2121
<plugin name="category_delete_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Category\Remove"/>
2222
</type>
23+
<type name="Magento\UrlRewrite\Model\StorageInterface">
24+
<plugin name="storage_plugin" type="Magento\CatalogUrlRewrite\Model\Category\Plugin\Storage"/>
25+
</type>
2326
</config>

app/code/Magento/Config/Model/Config/Structure/Element/Group/Proxy.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
*/
66
namespace Magento\Config\Model\Config\Structure\Element\Group;
77

8-
class Proxy extends \Magento\Config\Model\Config\Structure\Element\Group
8+
class Proxy extends \Magento\Config\Model\Config\Structure\Element\Group implements
9+
\Magento\Framework\ObjectManager\NoninterceptableInterface
910
{
1011
/**
1112
* Object manager

app/code/Magento/Config/Model/Config/Structure/Search/Proxy.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
*/
66
namespace Magento\Config\Model\Config\Structure\Search;
77

8-
class Proxy implements \Magento\Config\Model\Config\Structure\SearchInterface
8+
class Proxy implements
9+
\Magento\Config\Model\Config\Structure\SearchInterface,
10+
\Magento\Framework\ObjectManager\NoninterceptableInterface
911
{
1012
/**
1113
* Object manager

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Price.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ public function getFinalPrice($qty, $product)
2222
return $product->getCalculatedFinalPrice();
2323
}
2424
if ($product->getCustomOption('simple_product') && $product->getCustomOption('simple_product')->getProduct()) {
25-
return parent::getFinalPrice($qty, $product->getCustomOption('simple_product')->getProduct());
25+
$finalPrice = parent::getFinalPrice($qty, $product->getCustomOption('simple_product')->getProduct());
2626
} else {
2727
$priceInfo = $product->getPriceInfo();
2828
$finalPrice = $priceInfo->getPrice('final_price')->getAmount()->getValue();
29-
$finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);
30-
$finalPrice = max(0, $finalPrice);
31-
$product->setFinalPrice($finalPrice);
32-
33-
return $finalPrice;
3429
}
30+
$finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);
31+
$finalPrice = max(0, $finalPrice);
32+
$product->setFinalPrice($finalPrice);
33+
34+
return $finalPrice;
3535
}
3636

3737
/**

app/code/Magento/ConfigurableProduct/Pricing/Price/FinalPriceResolver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class FinalPriceResolver implements PriceResolverInterface
1616
*/
1717
public function resolvePrice(\Magento\Framework\Pricing\SaleableInterface $product)
1818
{
19-
return $product->getPriceInfo()->getPrice(CatalogFinalPrice::PRICE_CODE)
20-
->getAmount()->getBaseAmount();
19+
return $product->getPriceInfo()->getPrice(CatalogFinalPrice::PRICE_CODE)->getValue();
2120
}
2221
}

app/code/Magento/Paypal/Block/Iframe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ public function __construct(
8989
$this->_hssHelper = $hssHelper;
9090
$this->_orderFactory = $orderFactory;
9191
$this->_checkoutSession = $checkoutSession;
92-
parent::__construct($context, $data);
9392
$this->_isScopePrivate = true;
9493
$this->readFactory = $readFactory;
9594
$this->reader = $reader;
95+
parent::__construct($context, $data);
9696
}
9797

9898
/**

app/code/Magento/Paypal/Controller/Payflow.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public function __construct(
7373
*/
7474
protected function _cancelPayment($errorMsg = '')
7575
{
76+
$errorMsg = trim(strip_tags($errorMsg));
77+
7678
$gotoSection = false;
7779
$this->_checkoutHelper->cancelCurrentOrder($errorMsg);
7880
if ($this->_checkoutSession->restoreQuote()) {

app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Paypal\Controller\Payflow;
88

99
use Magento\Paypal\Controller\Payflow;
10+
use Magento\Paypal\Model\Config;
1011
use Magento\Sales\Model\Order;
1112

1213
class ReturnUrl extends Payflow
@@ -19,6 +20,15 @@ class ReturnUrl extends Payflow
1920
Order::STATE_COMPLETE,
2021
];
2122

23+
/**
24+
* Payment method code
25+
* @var string
26+
*/
27+
protected $allowedPaymentMethodCodes = [
28+
Config::METHOD_PAYFLOWPRO,
29+
Config::METHOD_PAYFLOWLINK
30+
];
31+
2232
/**
2333
* When a customer return to website from payflow gateway.
2434
*
@@ -35,16 +45,44 @@ public function execute()
3545
$order = $this->_orderFactory->create()->loadByIncrementId($this->_checkoutSession->getLastRealOrderId());
3646

3747
if ($order->getIncrementId()) {
38-
if (in_array($order->getState(), $this->allowedOrderStates)) {
48+
if ($this->checkOrderState($order)) {
3949
$redirectBlock->setData('goto_success_page', true);
4050
} else {
41-
$gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG')));
42-
$redirectBlock->setData('goto_section', $gotoSection);
43-
$redirectBlock->setData('error_msg', __('Your payment has been declined. Please try again.'));
51+
if ($this->checkPaymentMethod($order)) {
52+
$gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG')));
53+
$redirectBlock->setData('goto_section', $gotoSection);
54+
$redirectBlock->setData('error_msg', __('Your payment has been declined. Please try again.'));
55+
} else {
56+
$redirectBlock->setData('goto_section', false);
57+
$redirectBlock->setData('error_msg', __('Requested payment method does not match with order.'));
58+
}
4459
}
4560
}
4661
}
4762

4863
$this->_view->renderLayout();
4964
}
65+
66+
/**
67+
* Check order state
68+
*
69+
* @param Order $order
70+
* @return bool
71+
*/
72+
protected function checkOrderState(Order $order)
73+
{
74+
return in_array($order->getState(), $this->allowedOrderStates);
75+
}
76+
77+
/**
78+
* Check requested payment method
79+
*
80+
* @param Order $order
81+
* @return bool
82+
*/
83+
protected function checkPaymentMethod(Order $order)
84+
{
85+
$payment = $order->getPayment();
86+
return in_array($payment->getMethod(), $this->allowedPaymentMethodCodes);
87+
}
5088
}

app/code/Magento/Paypal/Controller/Payflowadvanced/ReturnUrl.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@
66
*/
77
namespace Magento\Paypal\Controller\Payflowadvanced;
88

9+
use Magento\Paypal\Model\Config;
10+
911
class ReturnUrl extends \Magento\Paypal\Controller\Payflow\ReturnUrl
1012
{
1113
/**
1214
* Redirect block name
1315
* @var string
1416
*/
1517
protected $_redirectBlockName = 'payflow.advanced.iframe';
18+
19+
/**
20+
* Payment method code
21+
* @var string
22+
*/
23+
protected $allowedPaymentMethodCodes = [
24+
Config::METHOD_PAYFLOWADVANCED
25+
];
1626
}

0 commit comments

Comments
 (0)