Skip to content

Commit 2c15904

Browse files
committed
Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-54211
2 parents a3f8af9 + 68a91a9 commit 2c15904

File tree

6 files changed

+12
-37
lines changed

6 files changed

+12
-37
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</arguments>
2020
</type>
2121

22-
<virtualType name="BraintreeAuthorizeDataBuilder" type="Magento\Payment\Gateway\Request\BuilderComposite">
22+
<virtualType name="BraintreeAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
2323
<arguments>
2424
<argument name="builders" xsi:type="array">
2525
<item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>
@@ -30,7 +30,7 @@
3030
</argument>
3131
</arguments>
3232
</virtualType>
33-
<virtualType name="BraintreeVaultAuthorizeDataBuilder" type="Magento\Payment\Gateway\Request\BuilderComposite">
33+
<virtualType name="BraintreeVaultAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
3434
<arguments>
3535
<argument name="builders" xsi:type="array">
3636
<item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>

app/code/Magento/Quote/Model/Quote/Item/CartItemPersister.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public function save(CartInterface $quote, CartItemInterface $item)
7171
/** Update item product options */
7272
$item = $quote->updateItem($itemId, $buyRequestData);
7373
} else {
74-
$currentItem->setQty($qty);
74+
if ($item->getQty() !== $currentItem->getQty()) {
75+
$currentItem->setQty($qty);
76+
}
7577
}
7678
} else {
7779
/** add new item to shopping cart */

app/code/Magento/Quote/Model/QuoteRepository/SaveHandler.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
*/
66
namespace Magento\Quote\Model\QuoteRepository;
77

8-
use Magento\Framework\App\ObjectManager;
98
use Magento\Quote\Api\Data\CartInterface;
109
use Magento\Framework\Exception\InputException;
11-
use Magento\Framework\Exception\CouldNotSaveException;
1210

1311
class SaveHandler
1412
{
@@ -32,11 +30,6 @@ class SaveHandler
3230
*/
3331
private $shippingAssignmentPersister;
3432

35-
/**
36-
* @var \Magento\Framework\Message\PhraseFactory
37-
*/
38-
private $phraseFactory;
39-
4033
/**
4134
* @param \Magento\Quote\Model\ResourceModel\Quote $quoteResource
4235
* @param \Magento\Quote\Model\Quote\Item\CartItemPersister $cartItemPersister
@@ -77,13 +70,6 @@ public function save(CartInterface $quote)
7770
}
7871
}
7972
}
80-
$errors = $quote->getErrors();
81-
if (!empty($errors)) {
82-
$phraseFactory = $this->getPhraseFactory();
83-
throw new CouldNotSaveException(
84-
$phraseFactory->create('Following errors occurred on save: %1', $errors)
85-
);
86-
}
8773

8874
// Billing Address processing
8975
$billingAddress = $quote->getBillingAddress();
@@ -97,18 +83,6 @@ public function save(CartInterface $quote)
9783
return $quote;
9884
}
9985

100-
/**
101-
* @deprecated
102-
* @return \Magento\Framework\Message\PhraseFactory
103-
*/
104-
private function getPhraseFactory()
105-
{
106-
if (!is_object($this->phraseFactory)) {
107-
$this->phraseFactory = ObjectManager::getInstance()->get(\Magento\Framework\Message\PhraseFactory::class);
108-
}
109-
return $this->phraseFactory;
110-
}
111-
11286
/**
11387
* @param \Magento\Quote\Model\Quote $quote
11488
* @return void

dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,10 @@ public function testReindexFull()
9999

100100
$this->indexerBuilder->reindexFull();
101101

102-
$this->assertEquals(9.8, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->product->getId()));
103-
$this->assertEquals(
104-
9.8,
105-
$this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productSecond->getId())
106-
);
102+
$rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->product->getId());
103+
$this->assertEquals(9.8, $rulePrice);
104+
$rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productSecond->getId());
105+
$this->assertEquals(9.8, $rulePrice);
107106
$this->assertFalse($this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productThird->getId()));
108107
}
109108

@@ -113,7 +112,7 @@ protected function prepareProducts()
113112
$product->load($product->getId());
114113
$this->product = $product;
115114

116-
$this->product->setData('test_attribute', 'test_attribute_value')->save();
115+
$this->product->setStoreId(0)->setData('test_attribute', 'test_attribute_value')->save();
117116
$this->productSecond = clone $this->product;
118117
$this->productSecond->setId(null)->setUrlKey('product-second')->save();
119118
$this->productThird = clone $this->product;

lib/internal/Magento/Framework/EntityManager/Operation/Create/CreateAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function execute($entity, $arguments = [])
5656
$entityData = array_merge($hydrator->extract($entity), $arguments);
5757
$actions = $this->attributePool->getActions($entityType, 'create');
5858
foreach ($actions as $action) {
59-
$action->execute($entityType, $entityData);
59+
$action->execute($entityType, $entityData, $arguments);
6060
}
6161
$entity = $hydrator->hydrate($entity, $entityData);
6262
return $entity;

lib/internal/Magento/Framework/EntityManager/Operation/Read.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function execute($entity, $identifier, $arguments = [])
110110
'arguments' => $arguments
111111
]
112112
);
113-
$entity = $this->readMain->execute($entity, $identifier, $arguments);
113+
$entity = $this->readMain->execute($entity, $identifier);
114114
$entityData = array_merge($hydrator->extract($entity), $arguments);
115115
if (isset($entityData[$metadata->getLinkField()])) {
116116
$entity = $this->readAttributes->execute($entity, $arguments);

0 commit comments

Comments
 (0)