Skip to content

Commit 5ee72e1

Browse files
committed
Merge remote-tracking branch 'origin/develop' into PR-webdev
2 parents a49baf8 + 1aa5f73 commit 5ee72e1

File tree

24 files changed

+530
-283
lines changed

24 files changed

+530
-283
lines changed

app/code/Magento/Catalog/Model/Product/Option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ protected function _getValidationRulesBeforeSave()
567567
public function getProductSku()
568568
{
569569
$productSku = $this->_getData(self::KEY_PRODUCT_SKU);
570-
if (!$productSku) {
570+
if (!$productSku && $this->getProduct()) {
571571
$productSku = $this->getProduct()->getSku();
572572
}
573573
return $productSku;

app/code/Magento/Catalog/Model/Product/Option/Repository.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ public function duplicate(
125125
*/
126126
public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $option)
127127
{
128-
$product = $this->productRepository->get($option->getProductSku());
128+
$productSku = $option->getProductSku();
129+
if (!$productSku) {
130+
throw new CouldNotSaveException(__('ProductSku should be specified'));
131+
}
132+
$product = $this->productRepository->get($productSku);
129133
$metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class);
130134
$option->setData('product_id', $product->getData($metadata->getLinkField()));
131135
$option->setOptionId(null);

app/code/Magento/Catalog/Setup/CategorySetup.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Magento\Framework\App\CacheInterface;
1515
use Magento\Framework\Setup\ModuleDataSetupInterface;
1616
use Magento\Catalog\Model\Product\Type;
17-
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
1817

1918
class CategorySetup extends EavSetup
2019
{
@@ -598,7 +597,7 @@ public function getDefaultEntities()
598597
'filterable' => true,
599598
'comparable' => true,
600599
'visible_in_advanced_search' => true,
601-
'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
600+
'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL]),
602601
'is_used_in_grid' => true,
603602
'is_visible_in_grid' => false,
604603
'is_filterable_in_grid' => true,

app/code/Magento/Catalog/Test/Unit/Model/Product/TypeTest.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ public function testFactory()
142142

143143
public function testPriceFactory()
144144
{
145-
$this->assertInstanceOf(
146-
'\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Price',
147-
$this->_model->priceFactory('type_id_3')
148-
);
149-
$this->assertInstanceOf(
150-
'\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Price',
151-
$this->_model->priceFactory('type_id_3')
152-
);
153145
$this->assertInstanceOf(
154146
'\Magento\Catalog\Model\Product\Type\Price',
155147
$this->_model->priceFactory('type_id_1')
@@ -318,7 +310,7 @@ private function getMockedTypePriceFactory()
318310
->will(
319311
$this->returnValueMap(
320312
[
321-
['some_model', [], $this->getMockedProductTypeConfigurablePrice()],
313+
['some_model', [], $this->getMockedProductTypePrice()],
322314
['Magento\Catalog\Model\Product\Type\Price', [], $this->getMockedProductTypePrice()],
323315
]
324316
)
@@ -338,16 +330,4 @@ private function getMockedProductTypePrice()
338330

339331
return $mock;
340332
}
341-
342-
/**
343-
* @return \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Price
344-
*/
345-
private function getMockedProductTypeConfigurablePrice()
346-
{
347-
$mockBuild = $this->getMockBuilder('\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Price')
348-
->disableOriginalConstructor();
349-
$mock = $mockBuild->getMock();
350-
351-
return $mock;
352-
}
353333
}

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -818,21 +818,6 @@ public function testSaveAndDuplicate()
818818
$this->model->afterSave();
819819
}
820820

821-
public function testGetIsSalableConfigurable()
822-
{
823-
$typeInstanceMock = $this->getMock(
824-
'Magento\ConfigurableProduct\Model\Product\Type\Configurable', ['getIsSalable'], [], '', false);
825-
826-
$typeInstanceMock
827-
->expects($this->atLeastOnce())
828-
->method('getIsSalable')
829-
->willReturn(true);
830-
831-
$this->model->setTypeInstance($typeInstanceMock);
832-
833-
self::assertTrue($this->model->getIsSalable());
834-
}
835-
836821
public function testGetIsSalableSimple()
837822
{
838823
$typeInstanceMock =

app/code/Magento/Catalog/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"magento/module-config": "100.0.*",
2727
"magento/module-media-storage": "100.0.*",
2828
"magento/framework": "100.0.*",
29-
"magento/module-configurable-product": "100.0.*",
3029
"magento/module-ui": "100.0.*"
3130
},
3231
"suggest": {

app/code/Magento/CatalogSearch/Model/Layer/Search/Plugin/CollectionFilter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public function aroundFilter(
4141
Category $category
4242
) {
4343
$proceed($collection, $category);
44-
$collection->addSearchFilter($this->queryFactory->get()->getQueryText());
44+
/** @var \Magento\Search\Model\Query $query */
45+
$query = $this->queryFactory->get();
46+
if (!$query->isQueryTextShort()) {
47+
$collection->addSearchFilter($query->getQueryText());
48+
}
4549
}
4650
}

app/code/Magento/ConfigurableProduct/Setup/InstallData.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
5353
'special_to_date',
5454
'tier_price',
5555
'weight',
56+
'color'
5657
];
5758
foreach ($attributes as $attributeCode) {
5859
$relatedProductTypes = explode(

app/code/Magento/GoogleOptimizer/Observer/AbstractSave.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function __construct(
5252
*
5353
* @param Observer $observer
5454
* @return $this
55-
* @throws \InvalidArgumentException
5655
*/
5756
public function execute(Observer $observer)
5857
{
@@ -182,7 +181,7 @@ protected function _deleteCode()
182181
}
183182

184183
/**
185-
* @return array
184+
* @return bool
186185
*/
187186
private function isDataAvailable()
188187
{

app/code/Magento/PageCache/Observer/FlushCacheByTags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
5454
if ($object instanceof \Magento\Framework\DataObject\IdentityInterface) {
5555
$tags = $object->getIdentities();
5656
if (!empty($tags)) {
57-
$this->getCache()->clean(\Zend_Cache::CLEANING_MODE_ALL, array_unique($tags));
57+
$this->getCache()->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array_unique($tags));
5858
}
5959
}
6060
}

0 commit comments

Comments
 (0)