Skip to content

Commit 26b744e

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento-engcom/magento2ce#2165: [MSI] Make Magento MSI test builds as mandatory part of all Pull Requests delivered to Magento core (by @ishakhsuvarov) - #17858: [Forwardport] Update issue templates for Magento 2 GitHub project (by @mage2pratik) - #18003: fix notice undefined shipment: revert locale inside loop (by @yaroslav-zenin) - #16708: [Forwardport] Resolved : JS files located outside the web/js directory (by @hitesh-wagento) - #17724: [Forwardport] 16544: fixed behaviour when some of JS validation rules making fields required (by @nmalevanec) - #17608: [Forwardport] Fix unstable session manager (by @jignesh-baldha) - #16791: [Forwardport] [TASK] Solve issue #14966 - Disabling product does not remove it from (by @gelanivishal) - #16571: Simplify code product alert email (by @arnoudhgz) Fixed GitHub Issues: - #16302: JS files located outside the web/js directory (reported by @BenSpace48) has been fixed in #16708 by @hitesh-wagento in 2.3-develop branch Related commits: 1. 0ce439b 2. 83a2966 3. d41ef75 4. 1fddf26 5. 6783664 - #16544: Some of JS validation rules making fields required (reported by @VitaliyBoyko) has been fixed in #17724 by @nmalevanec in 2.3-develop branch Related commits: 1. 63c3198 2. e7eba95 3. 2fc0817 4. bcf8b51 5. 6588dab - #12362: Concurrent (quick reload) requests on checkout cause cart to empty - related to session_regenerate_id (reported by @minlare) has been fixed in #17608 by @jignesh-baldha in 2.3-develop branch Related commits: 1. eee587b 2. 3828ac5 3. ac42b70 4. 5b6e78e 5. e688b8a 6. f53cfd7 7. bc15e1a - #14966: Disabling product does not remove it from the flat index (reported by @ktruehl) has been fixed in #16791 by @gelanivishal in 2.3-develop branch Related commits: 1. 68b6e67 2. 673a935 3. 80fbc9e 4. 13595a3 5. 8c83881 6. 92c1b10 7. eadb6b7
2 parents 3a236b3 + da44306 commit 26b744e

File tree

45 files changed

+422
-168
lines changed

Some content is hidden

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

45 files changed

+422
-168
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Technical issue with the Magento 2 core components
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Preconditions
12+
<!---
13+
Provide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.
14+
-->
15+
1.
16+
2.
17+
18+
### Steps to reproduce
19+
<!---
20+
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
21+
-->
22+
1.
23+
2.
24+
25+
### Expected result
26+
<!--- Tell us what do you expect to happen. -->
27+
1. [Screenshots, logs or description]
28+
2.
29+
30+
### Actual result
31+
<!--- Tell us what happened instead. Include error messages and issues. -->
32+
1. [Screenshots, logs or description]
33+
2.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Developer experience issue
3+
about: Issues related to customization, extensibility, modularity
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Summary
12+
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->
13+
14+
### Examples
15+
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->
16+
17+
### Proposed solution
18+
<!--- Suggest your potential solutions for this issue. -->
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Please consider reporting directly to https://github.com/magento/community-features
4+
5+
---
6+
7+
<!---
8+
Important: This repository is intended only for Magento 2 Technical Issues. Enter Feature Requests at https://github.com/magento/community-features. Project stakeholders monitor and manage requests. Feature requests entered using this form may be moved to the forum.
9+
-->
10+
11+
### Description
12+
<!--- Describe the feature you would like to add. -->
13+
14+
### Expected behavior
15+
<!--- What is the expected behavior of this feature? How is it going to work? -->
16+
17+
### Benefits
18+
<!--- How do you think this feature would improve Magento? -->
19+
20+
### Additional information
21+
<!--- What other information can you provide about the desired feature? -->

app/code/Magento/Authorizenet/view/frontend/requirejs-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
var config = {
77
map: {
88
'*': {
9-
transparent: 'Magento_Payment/transparent'
9+
transparent: 'Magento_Payment/js/transparent'
1010
}
1111
}
1212
};

app/code/Magento/Captcha/view/frontend/requirejs-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
var config = {
77
map: {
88
'*': {
9-
captcha: 'Magento_Captcha/captcha'
9+
captcha: 'Magento_Captcha/js/captcha'
1010
}
1111
}
1212
};

app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct(
6161
* @param int|null $id
6262
* @return \Magento\Catalog\Model\Indexer\Product\Flat\Action\Row
6363
* @throws \Magento\Framework\Exception\LocalizedException
64+
* @throws \Zend_Db_Statement_Exception
6465
*/
6566
public function execute($id = null)
6667
{
@@ -75,17 +76,43 @@ public function execute($id = null)
7576
if ($tableExists) {
7677
$this->flatItemEraser->removeDeletedProducts($ids, $store->getId());
7778
}
78-
if (isset($ids[0])) {
79-
if (!$tableExists) {
80-
$this->_flatTableBuilder->build(
81-
$store->getId(),
82-
[$ids[0]],
83-
$this->_valueFieldSuffix,
84-
$this->_tableDropSuffix,
85-
false
86-
);
79+
80+
/* @var $status \Magento\Eav\Model\Entity\Attribute */
81+
$status = $this->_productIndexerHelper->getAttribute('status');
82+
$statusTable = $status->getBackend()->getTable();
83+
$statusConditions = [
84+
'store_id IN(0,' . (int)$store->getId() . ')',
85+
'attribute_id = ' . (int)$status->getId(),
86+
'entity_id = ' . (int)$id
87+
];
88+
$select = $this->_connection->select();
89+
$select->from(
90+
$statusTable,
91+
['value']
92+
)->where(
93+
implode(' AND ', $statusConditions)
94+
)->order(
95+
'store_id DESC'
96+
);
97+
$result = $this->_connection->query($select);
98+
$status = $result->fetch(1);
99+
100+
if ($status['value'] == \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) {
101+
if (isset($ids[0])) {
102+
if (!$tableExists) {
103+
$this->_flatTableBuilder->build(
104+
$store->getId(),
105+
[$ids[0]],
106+
$this->_valueFieldSuffix,
107+
$this->_tableDropSuffix,
108+
false
109+
);
110+
}
111+
$this->flatItemWriter->write($store->getId(), $ids[0], $this->_valueFieldSuffix);
87112
}
88-
$this->flatItemWriter->write($store->getId(), $ids[0], $this->_valueFieldSuffix);
113+
}
114+
if ($status['value'] == \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED) {
115+
$this->flatItemEraser->deleteProductsFromStore($id, $store->getId());
89116
}
90117
}
91118
return $this;

app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
109
<test name="AdminApplyTierPriceToProductTest">
1110
<annotations>
1211
<features value="Catalog"/>
@@ -236,9 +235,10 @@
236235
<scrollToTopOfPage stepKey="scrollToTopOfPage5"/>
237236
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton5"/>
238237
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceDeleteButton}}" stepKey="waitForcustomerGroupPriceDeleteButton"/>
239-
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceDeleteButton}}" stepKey="deleteFirstRowOfCustomerGroupPrice"/>
240-
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceDeleteButton}}" stepKey="deleteSecondRowOfCustomerGroupPrice"/>
241-
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton5"/>
238+
<scrollTo selector="(//*[contains(@class, 'product_form_product_form_advanced_pricing_modal')]//tr//button[@data-action='remove_row'])[1]" x="30" y="0" stepKey="scrollToDeleteFirstRowOfCustomerGroupPrice" />
239+
<click selector="(//tr//button[@data-action='remove_row'])[1]" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="deleteFirstRowOfCustomerGroupPrice"/>
240+
<click selector="//tr//button[@data-action='remove_row']" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="deleteSecondRowOfCustomerGroupPrice"/>
241+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="clickDoneButton5"/>
242242
<actionGroup ref="saveProductForm" stepKey="saveProduct5"/>
243243
<scrollToTopOfPage stepKey="scrollToTopOfPage6"/>
244244
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton6"/>

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1010

11+
/**
12+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
13+
*/
1114
class RowTest extends \PHPUnit\Framework\TestCase
1215
{
1316
/**
@@ -59,6 +62,8 @@ protected function setUp()
5962
{
6063
$objectManager = new ObjectManager($this);
6164

65+
$attributeTable = 'catalog_product_entity_int';
66+
$statusId = 22;
6267
$this->connection = $this->createMock(\Magento\Framework\DB\Adapter\AdapterInterface::class);
6368
$this->resource = $this->createMock(\Magento\Framework\App\ResourceConnection::class);
6469
$this->resource->expects($this->any())->method('getConnection')
@@ -68,12 +73,41 @@ protected function setUp()
6873
$this->store = $this->createMock(\Magento\Store\Model\Store::class);
6974
$this->store->expects($this->any())->method('getId')->will($this->returnValue('store_id_1'));
7075
$this->storeManager->expects($this->any())->method('getStores')->will($this->returnValue([$this->store]));
71-
$this->productIndexerHelper = $this->createMock(\Magento\Catalog\Helper\Product\Flat\Indexer::class);
7276
$this->flatItemEraser = $this->createMock(\Magento\Catalog\Model\Indexer\Product\Flat\Action\Eraser::class);
7377
$this->flatItemWriter = $this->createMock(\Magento\Catalog\Model\Indexer\Product\Flat\Action\Indexer::class);
7478
$this->flatTableBuilder = $this->createMock(
7579
\Magento\Catalog\Model\Indexer\Product\Flat\FlatTableBuilder::class
7680
);
81+
$this->productIndexerHelper = $this->createMock(\Magento\Catalog\Helper\Product\Flat\Indexer::class);
82+
$statusAttributeMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute::class)
83+
->disableOriginalConstructor()
84+
->getMock();
85+
$this->productIndexerHelper->expects($this->any())->method('getAttribute')
86+
->with('status')
87+
->willReturn($statusAttributeMock);
88+
$backendMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend::class)
89+
->disableOriginalConstructor()
90+
->getMock();
91+
$backendMock->expects($this->any())->method('getTable')->willReturn($attributeTable);
92+
$statusAttributeMock->expects($this->any())->method('getBackend')->willReturn(
93+
$backendMock
94+
);
95+
$statusAttributeMock->expects($this->any())->method('getId')->willReturn($statusId);
96+
$selectMock = $this->getMockBuilder(\Magento\Framework\DB\Select::class)
97+
->disableOriginalConstructor()
98+
->getMock();
99+
$this->connection->expects($this->any())->method('select')->willReturn($selectMock);
100+
$selectMock->expects($this->any())->method('from')->with(
101+
$attributeTable,
102+
['value']
103+
)->willReturnSelf();
104+
$selectMock->expects($this->any())->method('where')->willReturnSelf();
105+
$pdoMock = $this->createMock(\Zend_Db_Statement_Pdo::class);
106+
$this->connection->expects($this->any())
107+
->method('query')
108+
->with($selectMock)
109+
->will($this->returnValue($pdoMock));
110+
$pdoMock->expects($this->any())->method('fetch')->will($this->returnValue(['value' => 1]));
77111

78112
$this->model = $objectManager->getObject(
79113
\Magento\Catalog\Model\Indexer\Product\Flat\Action\Row::class,

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<data key="visibility">4</data>
3030
<data key="name" unique="suffix">API Configurable Product</data>
3131
<data key="urlKey" unique="suffix">api-configurable-product</data>
32+
<data key="price">123.00</data>
33+
<data key="weight">2</data>
3234
<data key="status">1</data>
3335
<data key="quantity">100</data>
3436
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>

0 commit comments

Comments
 (0)