Skip to content

Commit e3948c1

Browse files
author
Oleksii Korshenko
authored
Merge pull request #789 from magento-okapis/MAGETWO-63884-Prepare-2.0.15
Prepare code base for 2.0.15
2 parents 6fad45d + 6b88cac commit e3948c1

File tree

91 files changed

+2128
-463
lines changed

Some content is hidden

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

91 files changed

+2128
-463
lines changed

app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ protected function setupOrderMock(
478478
'getCustomerEmail',
479479
'getCustomerId',
480480
'getStoreId',
481-
'getTotalDue'
481+
'getBaseTotalDue'
482482
]
483483
)->getMock();
484484

@@ -501,7 +501,7 @@ protected function setupOrderMock(
501501
->method('getStoreId')
502502
->willReturn($storeId);
503503
$orderMock->expects(static::any())
504-
->method('getTotalDue')
504+
->method('getBaseTotalDue')
505505
->willReturn(self::TOTAL_AMOUNT);
506506

507507
$this->orderRepository->expects(static::any())
@@ -1704,7 +1704,7 @@ protected function setupPaymentObjectForCapture($paymentId)
17041704
$order = $this->getMockBuilder('Magento\Sales\Api\Data\OrderInterface')
17051705
->getMockForAbstractClass();
17061706
$order->expects(static::any())
1707-
->method('getTotalDue')
1707+
->method('getBaseTotalDue')
17081708
->willReturn(self::TOTAL_AMOUNT);
17091709
$this->orderRepository->expects(static::any())
17101710
->method('get')

app/code/Magento/Braintree/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"magento/module-checkout-agreements": "100.0.*"
2323
},
2424
"type": "magento2-module",
25-
"version": "100.0.8",
25+
"version": "100.0.9",
2626
"license": [
2727
"proprietary"
2828
],

app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Catalog\Controller\Adminhtml\Category;
77

8+
use Magento\Store\Model\StoreManagerInterface;
9+
810
/**
911
* Class Save
1012
*/
@@ -25,6 +27,11 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Category
2527
*/
2628
protected $layoutFactory;
2729

30+
/**
31+
* @var StoreManagerInterface
32+
*/
33+
private $storeManager;
34+
2835
/**
2936
* Constructor
3037
*
@@ -82,6 +89,9 @@ public function execute()
8289
}
8390

8491
$storeId = $this->getRequest()->getParam('store');
92+
$store = $this->getStoreManager()->getStore($storeId);
93+
$this->getStoreManager()->setCurrentStore($store->getCode());
94+
8595
$refreshTree = false;
8696
$data = $this->getRequest()->getPostValue();
8797
if ($data) {
@@ -90,9 +100,7 @@ public function execute()
90100
$parentId = $this->getRequest()->getParam('parent');
91101
if (!$parentId) {
92102
if ($storeId) {
93-
$parentId = $this->_objectManager->get(
94-
'Magento\Store\Model\StoreManagerInterface'
95-
)->getStore(
103+
$parentId = $this->getStoreManager()->getStore(
96104
$storeId
97105
)->getRootCategoryId();
98106
} else {
@@ -211,4 +219,18 @@ public function execute()
211219
$redirectParams
212220
);
213221
}
222+
223+
/**
224+
* Get StoreManager object
225+
*
226+
* @return StoreManagerInterface
227+
*/
228+
private function getStoreManager()
229+
{
230+
if ($this->storeManager == null) {
231+
$this->storeManager = $this->_objectManager->get(StoreManagerInterface::class);
232+
}
233+
234+
return $this->storeManager;
235+
}
214236
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Catalog\Controller\Adminhtml\Product\Initialization;
78

9+
/**
10+
* Product initialization helper class
11+
*/
812
class Helper
913
{
1014
/**
@@ -71,7 +75,7 @@ public function __construct(
7175
*/
7276
public function initialize(\Magento\Catalog\Model\Product $product)
7377
{
74-
$productData = $this->request->getPost('product');
78+
$productData = $this->request->getPost('product', []);
7579
unset($productData['custom_attributes']);
7680
unset($productData['extension_attributes']);
7781

@@ -144,6 +148,13 @@ public function initialize(\Magento\Catalog\Model\Product $product)
144148
$productData['options'],
145149
$this->request->getPost('options_use_default')
146150
);
151+
foreach ($options as &$customOptionData) {
152+
if (isset($customOptionData['values'])) {
153+
$customOptionData['values'] = array_filter($customOptionData['values'], function ($valueData) {
154+
return !($valueData['option_type_id'] == '-1' && !empty($valueData['is_delete']));
155+
});
156+
}
157+
}
147158
$product->setProductOptions($options);
148159
}
149160

app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Backend\App\Action;
1010
use Magento\Catalog\Controller\Adminhtml\Product;
1111

12+
/**
13+
* Class that handle new product creation
14+
*/
1215
class NewAction extends \Magento\Catalog\Controller\Adminhtml\Product
1316
{
1417
/**

app/code/Magento/Catalog/Model/ResourceModel/Category/Collection/Factory.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Catalog\Model\ResourceModel\Category\Collection;
77

8+
/**
9+
* Category collection factory.
10+
*/
811
class Factory
912
{
1013
/**

app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\Catalog\Model\ResourceModel\Category;
77

88
use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
9+
use Magento\Catalog\Model\ResourceModel\Category\Flat\CollectionFactory as CategoryFlatCollectionFactory;
10+
use Magento\Framework\App\ObjectManager;
911

1012
/**
1113
* Category flat model
@@ -68,6 +70,7 @@ class Flat extends \Magento\Indexer\Model\ResourceModel\AbstractResource
6870
* Category collection factory
6971
*
7072
* @var \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory
73+
* @deprecated
7174
*/
7275
protected $_categoryCollectionFactory;
7376

@@ -78,6 +81,11 @@ class Flat extends \Magento\Indexer\Model\ResourceModel\AbstractResource
7881
*/
7982
protected $_categoryFactory;
8083

84+
/**
85+
* @var CategoryFlatCollectionFactory
86+
*/
87+
private $categoryFlatCollectionFactory;
88+
8189
/**
8290
* Class constructor
8391
*
@@ -399,7 +407,7 @@ public function getCategories($parent, $recursionLevel = 0, $sorted = false, $as
399407
);
400408
$parentPath = $this->getConnection()->fetchOne($select);
401409

402-
$collection = $this->_categoryCollectionFactory
410+
$collection = $this->getCategoryFlatCollectionFactory()
403411
->create()
404412
->addNameToResult()
405413
->addUrlRewriteToResult()
@@ -690,4 +698,19 @@ public function getProductsPosition($category)
690698

691699
return $this->getConnection()->fetchPairs($select, $bind);
692700
}
701+
702+
/**
703+
* Get instance of CategoryFlatCollectionFactory
704+
*
705+
* @return CategoryFlatCollectionFactory
706+
*/
707+
private function getCategoryFlatCollectionFactory()
708+
{
709+
if (!$this->categoryFlatCollectionFactory instanceof CategoryFlatCollectionFactory) {
710+
$this->categoryFlatCollectionFactory = ObjectManager::getInstance()
711+
->get(CategoryFlatCollectionFactory::class);
712+
}
713+
714+
return $this->categoryFlatCollectionFactory;
715+
}
693716
}

0 commit comments

Comments
 (0)