Skip to content

Commit 59d1577

Browse files
committed
Merge branch 'maindevelop' into bugfix
2 parents c47a085 + 1aa5f73 commit 59d1577

File tree

37 files changed

+555
-533
lines changed

37 files changed

+555
-533
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/ProductLink/RepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected function setUp()
9797
false
9898
);
9999
$this->hydratorMock = $this->getMock(
100-
'Magento\Framework\Model\Entity\EntityHydrator',
100+
'Magento\Framework\Model\Entity\Hydrator',
101101
['extract'],
102102
[],
103103
'',

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/Catalog/etc/di.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -542,18 +542,6 @@
542542
</argument>
543543
</arguments>
544544
</type>
545-
<type name="Magento\Framework\Model\OrchestratorPool">
546-
<arguments>
547-
<argument name="operations" xsi:type="array">
548-
<item name="default" xsi:type="array">
549-
<item name="read" xsi:type="string">Magento\Framework\Model\Operation\Read</item>
550-
<item name="create" xsi:type="string">Magento\Framework\EntityManager\Operation\Write\Create</item>
551-
<item name="update" xsi:type="string">Magento\Framework\EntityManager\Operation\Write\Update</item>
552-
<item name="delete" xsi:type="string">Magento\Framework\EntityManager\Operation\Write\Delete</item>
553-
</item>
554-
</argument>
555-
</arguments>
556-
</type>
557545
<type name="Magento\Framework\Model\Entity\RepositoryFactory">
558546
<arguments>
559547
<argument name="entities" xsi:type="array">

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(

0 commit comments

Comments
 (0)