Skip to content

Commit 1ba1d18

Browse files
merge magento/2.4-develop into magento-tsg/2.4-develop-pr10
2 parents 67ace7d + 8628eb8 commit 1ba1d18

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,9 @@ private function getChildrenCategories(int $categoryId): array
21212121
if (in_array($category['parent_id'], $categoryIds)
21222122
&& in_array($category['parent_id'], $anchorCategory)) {
21232123
$categoryIds[] = (int)$category[$linkField];
2124-
if ($category['is_anchor'] == 1) {
2124+
// Storefront approach is to treat non-anchor children of anchor category as anchors.
2125+
// Adding their's IDs to $anchorCategory for consistency.
2126+
if ($category['is_anchor'] == 1 || in_array($category['parent_id'], $anchorCategory)) {
21252127
$anchorCategory[] = (int)$category[$linkField];
21262128
}
21272129
}

dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ protected function setUp()
6868
*/
6969
public function testExecuteWithPaymentOperation()
7070
{
71+
/** @var OrderService|MockObject $orderService */
72+
$orderService = $this->getMockBuilder(OrderService::class)
73+
->disableOriginalConstructor()
74+
->getMock();
75+
$orderService->method('place')
76+
->willThrowException(new LocalizedException(__('Transaction has been declined.')));
77+
$this->_objectManager->addSharedInstance($orderService, OrderService::class);
78+
7179
$quote = $this->getQuote('2000000001');
7280
$session = $this->_objectManager->get(Quote::class);
7381
$session->setQuoteId($quote->getId());
@@ -82,14 +90,6 @@ public function testExecuteWithPaymentOperation()
8290
$this->getRequest()->setMethod(Http::METHOD_POST);
8391
$this->getRequest()->setPostValue(['order' => $data]);
8492

85-
/** @var OrderService|MockObject $orderService */
86-
$orderService = $this->getMockBuilder(OrderService::class)
87-
->disableOriginalConstructor()
88-
->getMock();
89-
$orderService->method('place')
90-
->willThrowException(new LocalizedException(__('Transaction has been declined.')));
91-
$this->_objectManager->addSharedInstance($orderService, OrderService::class);
92-
9393
$this->dispatch('backend/sales/order_create/save');
9494
$this->assertSessionMessages(
9595
self::equalTo(['Transaction has been declined.']),

dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private static function getAddedFilesList($changedFilesBaseDir)
142142
function () {
143143
// if no list files, probably, this is the dev environment
144144
// phpcs:ignore Generic.PHP.NoSilencedErrors,Magento2.Security.InsecureFunction
145-
@exec('git diff --cached --name-only', $addedFiles);
145+
@exec('git diff --cached --name-only --diff-filter=A', $addedFiles);
146146
return $addedFiles;
147147
}
148148
);

0 commit comments

Comments
 (0)