Skip to content

Commit 017e04f

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into publication
2 parents b029d24 + ad5e6b2 commit 017e04f

File tree

23 files changed

+413
-301
lines changed

23 files changed

+413
-301
lines changed

app/code/Magento/Bundle/Model/Resource/Indexer/Price.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -529,27 +529,6 @@ protected function _prepareBundlePrice($entityIds = null)
529529
$this->_prepareBundlePriceByType(\Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED, $entityIds);
530530
$this->_prepareBundlePriceByType(\Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC, $entityIds);
531531

532-
/**
533-
* Add possibility modify prices from external events
534-
*/
535-
$select = $this->_getWriteAdapter()->select()->join(
536-
['wd' => $this->_getWebsiteDateTable()],
537-
'i.website_id = wd.website_id',
538-
[]
539-
);
540-
$this->_eventManager->dispatch(
541-
'prepare_catalog_product_price_index_table',
542-
[
543-
'index_table' => ['i' => $this->_getBundlePriceTable()],
544-
'select' => $select,
545-
'entity_id' => 'i.entity_id',
546-
'customer_group_id' => 'i.customer_group_id',
547-
'website_id' => 'i.website_id',
548-
'website_date' => 'wd.website_date',
549-
'update_fields' => ['price', 'min_price', 'max_price']
550-
]
551-
);
552-
553532
$this->_calculateBundleOptionPrice();
554533
$this->_applyCustomOption();
555534

app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -318,28 +318,6 @@ protected function _prepareFinalPriceData($entityIds = null)
318318

319319
$query = $select->insertFromSelect($this->_getDefaultFinalPriceTable(), [], false);
320320
$write->query($query);
321-
322-
/**
323-
* Add possibility modify prices from external events
324-
*/
325-
$select = $write->select()->join(
326-
['wd' => $this->_getWebsiteDateTable()],
327-
'i.website_id = wd.website_id',
328-
[]
329-
);
330-
$this->_eventManager->dispatch(
331-
'prepare_catalog_product_price_index_table',
332-
[
333-
'index_table' => ['i' => $this->_getDefaultFinalPriceTable()],
334-
'select' => $select,
335-
'entity_id' => 'i.entity_id',
336-
'customer_group_id' => 'i.customer_group_id',
337-
'website_id' => 'i.website_id',
338-
'website_date' => 'wd.website_date',
339-
'update_fields' => ['price', 'min_price', 'max_price']
340-
]
341-
);
342-
343321
return $this;
344322
}
345323

app/code/Magento/CatalogRule/Model/Observer.php

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ class Observer
4747
*/
4848
protected $_customerSession;
4949

50-
/**
51-
* @var Price
52-
*/
53-
protected $_productPrice;
54-
5550
/**
5651
* @var \Magento\CatalogRule\Model\Resource\Rule\CollectionFactory
5752
*/
@@ -86,7 +81,6 @@ class Observer
8681
* @param Resource\RuleFactory $resourceRuleFactory
8782
* @param Resource\Rule $resourceRule
8883
* @param Resource\Rule\CollectionFactory $ruleCollectionFactory
89-
* @param Price $productPrice
9084
* @param StoreManagerInterface $storeManager
9185
* @param TimezoneInterface $localeDate
9286
* @param CustomerModelSession $customerSession
@@ -100,7 +94,6 @@ public function __construct(
10094
Resource\RuleFactory $resourceRuleFactory,
10195
Resource\Rule $resourceRule,
10296
Resource\Rule\CollectionFactory $ruleCollectionFactory,
103-
Rule\Product\Price $productPrice,
10497
StoreManagerInterface $storeManager,
10598
TimezoneInterface $localeDate,
10699
CustomerModelSession $customerSession,
@@ -111,7 +104,6 @@ public function __construct(
111104
$this->_resourceRuleFactory = $resourceRuleFactory;
112105
$this->_resourceRule = $resourceRule;
113106
$this->_ruleCollectionFactory = $ruleCollectionFactory;
114-
$this->_productPrice = $productPrice;
115107
$this->_storeManager = $storeManager;
116108
$this->_localeDate = $localeDate;
117109
$this->_customerSession = $customerSession;
@@ -215,36 +207,6 @@ public function flushPriceCache()
215207
$this->_rulePrices = [];
216208
}
217209

218-
/**
219-
* Calculate minimal final price with catalog rule price
220-
*
221-
* @param EventObserver $observer
222-
* @return $this
223-
*/
224-
public function prepareCatalogProductPriceIndexTable(EventObserver $observer)
225-
{
226-
$select = $observer->getEvent()->getSelect();
227-
228-
$indexTable = $observer->getEvent()->getIndexTable();
229-
$entityId = $observer->getEvent()->getEntityId();
230-
$customerGroupId = $observer->getEvent()->getCustomerGroupId();
231-
$websiteId = $observer->getEvent()->getWebsiteId();
232-
$websiteDate = $observer->getEvent()->getWebsiteDate();
233-
$updateFields = $observer->getEvent()->getUpdateFields();
234-
235-
$this->_productPrice->applyPriceRuleToIndexTable(
236-
$select,
237-
$indexTable,
238-
$entityId,
239-
$customerGroupId,
240-
$websiteId,
241-
$updateFields,
242-
$websiteDate
243-
);
244-
245-
return $this;
246-
}
247-
248210
/**
249211
* @param EventObserver $observer
250212
* @return $this

app/code/Magento/CatalogRule/etc/events.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/code/Magento/Customer/etc/data_source/customer_address.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</field>
5050
<field name="region" source="eav" formElement="input" visible="false"/>
5151

52-
<field name="postcode" source="eav" formElement="post_code_fix" >
52+
<field name="postcode" source="eav" formElement="post_code" >
5353
<constraints>
5454
<validate name="required-entry"/>
5555
</constraints>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Developer\Model\Less\FileGenerator;
7+
8+
use Magento\Framework\Less\FileGenerator\RelatedGenerator;
9+
use Magento\Framework\View\Asset\LocalInterface;
10+
11+
/**
12+
* Class PublicationDecorator
13+
* Decorates generator of related assets and publishes them
14+
*
15+
* @package Magento\Developer\Model\Less\FileGenerator
16+
*/
17+
class PublicationDecorator extends RelatedGenerator
18+
{
19+
/**
20+
* @var \Magento\Framework\App\View\Asset\Publisher
21+
*/
22+
private $publisher;
23+
24+
/**
25+
* @param \Magento\Framework\Filesystem $filesystem
26+
* @param \Magento\Framework\View\Asset\Repository $assetRepo
27+
* @param \Magento\Framework\Less\File\Temporary $temporaryFile
28+
* @param \Magento\Framework\App\View\Asset\Publisher $publisher
29+
*/
30+
public function __construct(
31+
\Magento\Framework\Filesystem $filesystem,
32+
\Magento\Framework\View\Asset\Repository $assetRepo,
33+
\Magento\Framework\Less\File\Temporary $temporaryFile,
34+
\Magento\Framework\App\View\Asset\Publisher $publisher
35+
) {
36+
parent::__construct($filesystem, $assetRepo, $temporaryFile);
37+
$this->publisher = $publisher;
38+
}
39+
40+
/**
41+
* {inheritdoc}
42+
*/
43+
protected function generateRelatedFile($relatedFileId, LocalInterface $asset)
44+
{
45+
$relatedAsset = parent::generateRelatedFile($relatedFileId, $asset);
46+
$this->publisher->publish($relatedAsset);
47+
return $relatedAsset;
48+
}
49+
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,9 +2042,7 @@ public function addMessage($message, $index = 'error')
20422042
return $this;
20432043
}
20442044

2045-
if (is_string($message)) {
2046-
$message = $this->messageFactory->create(\Magento\Framework\Message\MessageInterface::TYPE_ERROR, $message);
2047-
}
2045+
$message = $this->messageFactory->create(\Magento\Framework\Message\MessageInterface::TYPE_ERROR, $message);
20482046

20492047
$messages[$index] = $message;
20502048
$this->setData('messages', $messages);

app/code/Magento/Sales/Controller/Guest/PrintAction.php

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

9+
use Magento\Framework\App\Action\Context;
10+
use Magento\Framework\View\Result\PageFactory;
11+
912
class PrintAction extends \Magento\Sales\Controller\AbstractController\PrintAction
1013
{
14+
/**
15+
* @param Context $context
16+
* @param OrderLoader $orderLoader
17+
* @param PageFactory $resultPageFactory
18+
*/
19+
public function __construct(
20+
Context $context,
21+
\Magento\Sales\Controller\Guest\OrderLoader $orderLoader,
22+
PageFactory $resultPageFactory
23+
) {
24+
parent::__construct($context, $orderLoader, $resultPageFactory);
25+
}
1126
}

app/code/Magento/Sales/Controller/Guest/Reorder.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66
*/
77
namespace Magento\Sales\Controller\Guest;
88

9+
use Magento\Framework\App\Action;
10+
use Magento\Framework\Controller\Result\RedirectFactory;
11+
912
class Reorder extends \Magento\Sales\Controller\AbstractController\Reorder
1013
{
14+
/**
15+
* @param Action\Context $context
16+
* @param \Magento\Sales\Controller\Guest\OrderLoader $orderLoader
17+
* @param \Magento\Framework\Registry $registry
18+
* @param \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory
19+
*/
20+
public function __construct(
21+
Action\Context $context,
22+
\Magento\Sales\Controller\Guest\OrderLoader $orderLoader,
23+
\Magento\Framework\Registry $registry,
24+
RedirectFactory $resultRedirectFactory
25+
) {
26+
parent::__construct($context, $orderLoader, $registry, $resultRedirectFactory);
27+
}
1128
}

app/etc/di.xml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,6 @@
557557
<argument name="publisher" xsi:type="object">developerPublisher</argument>
558558
</arguments>
559559
</type>
560-
<type name="Magento\Framework\View\Asset\SourceFileGeneratorPool">
561-
<arguments>
562-
<argument name="fileGeneratorTypes" xsi:type="array">
563-
<item name="less" xsi:type="object">Magento\Framework\Less\FileGenerator</item>
564-
</argument>
565-
</arguments>
566-
</type>
567560
<virtualType name="developerPublisher" type="Magento\Framework\App\View\Asset\Publisher">
568561
<arguments>
569562
<argument name="materializationStrategyFactory" xsi:type="object">developerMaterialization</argument>
@@ -577,24 +570,23 @@
577570
</argument>
578571
</arguments>
579572
</virtualType>
580-
<virtualType name="lessFileGeneratorMaterialization" type="Magento\Framework\App\View\Asset\MaterializationStrategy\Factory">
573+
<type name="Magento\Framework\View\Asset\SourceFileGeneratorPool">
581574
<arguments>
582-
<argument name="strategiesList" xsi:type="array">
583-
<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>
584-
<item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
575+
<argument name="fileGeneratorTypes" xsi:type="array">
576+
<item name="less" xsi:type="object">fileassemblerFileGenerator</item>
585577
</argument>
586578
</arguments>
587-
</virtualType>
588-
<virtualType name="lessFileGeneratorPublisher" type="Magento\Framework\App\View\Asset\Publisher">
579+
</type>
580+
<virtualType name="fileassemblerFileGenerator" type="Magento\Framework\Less\FileGenerator">
589581
<arguments>
590-
<argument name="materializationStrategyFactory" xsi:type="object">lessFileGeneratorMaterialization</argument>
582+
<argument name="relatedGenerator" xsi:type="object">fileassemblerRelatedFilesGenerator</argument>
591583
</arguments>
592584
</virtualType>
593-
<type name="Magento\Framework\Less\FileGenerator">
585+
<virtualType name="fileassemblerRelatedFilesGenerator" type="Magento\Developer\Model\Less\FileGenerator\PublicationDecorator">
594586
<arguments>
595-
<argument name="publisher" xsi:type="object">lessFileGeneratorPublisher</argument>
587+
<argument name="publisher" xsi:type="object">developerPublisher</argument>
596588
</arguments>
597-
</type>
589+
</virtualType>
598590
<virtualType name="fallbackResolverSimpleWithGroupedCache" type="Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple">
599591
<arguments>
600592
<argument name="cache" xsi:type="object">Magento\Framework\View\Design\FileResolution\Fallback\CacheData\Grouped</argument>

0 commit comments

Comments
 (0)