Skip to content

Commit 523a83e

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #19889: [Backport]Fix issue 19507 - Frontend Minicart dropdown alignment issue (by @speedy008) - #19910: [Backport] fixed Notification page Select Visible items issue (by @shikhamis11) - #19928: [Backport] [Review] Integration tests for not allowed review submission (by @eduard13) - #19056: Fix issue 19052- Position order showing before the text box (by @speedy008) - #19989: [Backport] Fixed #19605 Don't static compile disabled modules (by @shikhamis11) Fixed GitHub Issues: - #19507: Frontend Minicart dropdown alignment issue (reported by @speedy008) has been fixed in #19889 by @speedy008 in 2.2-develop branch Related commits: 1. afba6e4 - #19285: On Notification page Select All and Select Visible both works same (reported by @hellotaran) has been fixed in #19910 by @shikhamis11 in 2.2-develop branch Related commits: 1. 9804da7 2. c4bf9d2 3. 9e37895 4. b39a770 5. c0ea9e4 6. 0810a4a 7. a69b2d9 8. 598881f 9. 84461c5 10. 8397479 11. 3808266 12. 108b190 13. 25a6c2e 14. 4fd5c95 15. 2c55232 - #19052: Position order showing before the text box (reported by @Dharmeshvaja91) has been fixed in #19056 by @speedy008 in 2.2-develop branch Related commits: 1. 9e1459a - #19605: Don't static compile disabled modules (reported by @joshuaadickerson) has been fixed in #19989 by @shikhamis11 in 2.2-develop branch Related commits: 1. 1f5ec6f 2. 484b79a 3. d291cf3
2 parents 88e5cda + 39dd340 commit 523a83e

File tree

6 files changed

+199
-19
lines changed

6 files changed

+199
-19
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Backend\Block\Widget\Grid\Massaction;
77

88
use Magento\Backend\Block\Widget\Grid\Massaction\VisibilityCheckerInterface as VisibilityChecker;
9+
use Magento\Framework\Data\Collection\AbstractDb;
910
use Magento\Framework\DataObject;
1011

1112
/**
@@ -51,7 +52,7 @@ public function __construct(
5152
}
5253

5354
/**
54-
* @return void
55+
* @inheritdoc
5556
*/
5657
protected function _construct()
5758
{
@@ -216,6 +217,7 @@ public function getGridJsObjectName()
216217
* Retrieve JSON string of selected checkboxes
217218
*
218219
* @return string
220+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
219221
*/
220222
public function getSelectedJson()
221223
{
@@ -230,6 +232,7 @@ public function getSelectedJson()
230232
* Retrieve array of selected checkboxes
231233
*
232234
* @return string[]
235+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
233236
*/
234237
public function getSelected()
235238
{
@@ -251,6 +254,8 @@ public function getApplyButtonHtml()
251254
}
252255

253256
/**
257+
* Get mass action javascript code.
258+
*
254259
* @return string
255260
*/
256261
public function getJavaScript()
@@ -267,6 +272,8 @@ public function getJavaScript()
267272
}
268273

269274
/**
275+
* Get grid ids in JSON format.
276+
*
270277
* @return string
271278
*/
272279
public function getGridIdsJson()
@@ -282,7 +289,11 @@ public function getGridIdsJson()
282289
} else {
283290
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
284291
}
285-
292+
if ($allIdsCollection instanceof AbstractDb) {
293+
$allIdsCollection->getSelect()->limit();
294+
$allIdsCollection->clear();
295+
}
296+
286297
$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
287298
if (!empty($gridIds)) {
288299
return join(",", $gridIds);
@@ -291,6 +302,8 @@ public function getGridIdsJson()
291302
}
292303

293304
/**
305+
* Get Html id.
306+
*
294307
* @return string
295308
*/
296309
public function getHtmlId()

app/code/Magento/Deploy/Collector/Collector.php

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66
namespace Magento\Deploy\Collector;
77

8-
use Magento\Deploy\Source\SourcePool;
98
use Magento\Deploy\Package\Package;
109
use Magento\Deploy\Package\PackageFactory;
10+
use Magento\Deploy\Source\SourcePool;
11+
use Magento\Deploy\Package\PackageFile;
12+
use Magento\Framework\Module\Manager;
1113
use Magento\Framework\View\Asset\PreProcessor\FileNameResolver;
1214

1315
/**
@@ -44,6 +46,9 @@ class Collector implements CollectorInterface
4446
*/
4547
private $packageFactory;
4648

49+
/** @var \Magento\Framework\Module\Manager */
50+
private $moduleManager;
51+
4752
/**
4853
* Default values for package primary identifiers
4954
*
@@ -61,15 +66,19 @@ class Collector implements CollectorInterface
6166
* @param SourcePool $sourcePool
6267
* @param FileNameResolver $fileNameResolver
6368
* @param PackageFactory $packageFactory
69+
* @param Manager $moduleManager
6470
*/
6571
public function __construct(
6672
SourcePool $sourcePool,
6773
FileNameResolver $fileNameResolver,
68-
PackageFactory $packageFactory
74+
PackageFactory $packageFactory,
75+
Manager $moduleManager = null
6976
) {
7077
$this->sourcePool = $sourcePool;
7178
$this->fileNameResolver = $fileNameResolver;
7279
$this->packageFactory = $packageFactory;
80+
$this->moduleManager = $moduleManager ?: \Magento\Framework\App\ObjectManager::getInstance()
81+
->get(Manager::class);
7382
}
7483

7584
/**
@@ -81,19 +90,11 @@ public function collect()
8190
foreach ($this->sourcePool->getAll() as $source) {
8291
$files = $source->get();
8392
foreach ($files as $file) {
84-
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
85-
$params = [
86-
'area' => $file->getArea(),
87-
'theme' => $file->getTheme(),
88-
'locale' => $file->getLocale(),
89-
'module' => $file->getModule(),
90-
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
91-
];
92-
foreach ($this->packageDefaultValues as $name => $value) {
93-
if (!isset($params[$name])) {
94-
$params[$name] = $value;
95-
}
93+
if ($file->getModule() && !$this->moduleManager->isEnabled($file->getModule())) {
94+
continue;
9695
}
96+
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
97+
$params = $this->getParams($file);
9798
$packagePath = "{$params['area']}/{$params['theme']}/{$params['locale']}";
9899
if (!isset($packages[$packagePath])) {
99100
$packages[$packagePath] = $this->packageFactory->create($params);
@@ -105,4 +106,28 @@ public function collect()
105106
}
106107
return $packages;
107108
}
109+
110+
/**
111+
* Retrieve package params.
112+
*
113+
* @param PackageFile $file
114+
* @return array
115+
*/
116+
private function getParams(PackageFile $file)
117+
{
118+
$params = [
119+
'area' => $file->getArea(),
120+
'theme' => $file->getTheme(),
121+
'locale' => $file->getLocale(),
122+
'module' => $file->getModule(),
123+
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
124+
];
125+
foreach ($this->packageDefaultValues as $name => $value) {
126+
if (!isset($params[$name])) {
127+
$params[$name] = $value;
128+
}
129+
}
130+
131+
return $params;
132+
}
108133
}

app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
}
1616
}
1717

18+
.catalog-category-edit {
19+
.admin__grid-control {
20+
.admin__grid-control-value {
21+
display: none;
22+
}
23+
}
24+
}
25+
1826
.product-composite-configure-inner {
1927
.admin__control-text {
2028
&.qty {

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@
110110
@_toggle-selector: ~'.action.showcart',
111111
@_options-selector: ~'.block-minicart',
112112
@_dropdown-list-width: 320px,
113-
@_dropdown-list-position-right: 0px,
113+
@_dropdown-list-position-right: -10px,
114114
@_dropdown-list-pointer-position: right,
115-
@_dropdown-list-pointer-position-left-right: 26px,
115+
@_dropdown-list-pointer-position-left-right: 12px,
116116
@_dropdown-list-z-index: 101,
117117
@_dropdown-toggle-icon-content: @icon-cart,
118118
@_dropdown-toggle-active-icon-content: @icon-cart,
@@ -412,7 +412,6 @@
412412
margin-left: 13px;
413413

414414
.block-minicart {
415-
right: -15px;
416415
width: 390px;
417416
}
418417
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Review\Controller;
7+
8+
use Magento\Catalog\Api\Data\ProductInterface;
9+
use Magento\Catalog\Api\ProductRepositoryInterface;
10+
use Magento\Framework\Data\Form\FormKey;
11+
use Magento\Framework\Message\MessageInterface;
12+
use Magento\TestFramework\Request;
13+
use Magento\TestFramework\TestCase\AbstractController;
14+
15+
/**
16+
* Test review product controller behavior
17+
*
18+
* @magentoAppArea frontend
19+
*/
20+
class CaseCheckAddingProductReviewTest extends AbstractController
21+
{
22+
/**
23+
* Test adding a review for allowed guests with incomplete data by a not logged in user
24+
*
25+
* @magentoDbIsolation enabled
26+
* @magentoAppIsolation enabled
27+
* @magentoDataFixture Magento/Review/_files/config.php
28+
* @magentoDataFixture Magento/Catalog/_files/products.php
29+
*/
30+
public function testAttemptForGuestToAddReviewsWithIncompleteData()
31+
{
32+
$product = $this->getProduct();
33+
/** @var FormKey $formKey */
34+
$formKey = $this->_objectManager->get(FormKey::class);
35+
$post = [
36+
'nickname' => 'Test nick',
37+
'title' => 'Summary',
38+
'form_key' => $formKey->getFormKey(),
39+
];
40+
$this->prepareRequestData($post);
41+
$this->dispatch('review/product/post/id/' . $product->getId());
42+
$this->assertSessionMessages(
43+
$this->equalTo(['Please enter a review.']),
44+
MessageInterface::TYPE_ERROR
45+
);
46+
}
47+
48+
/**
49+
* Test adding a review for not allowed guests by a guest
50+
*
51+
* @magentoDbIsolation enabled
52+
* @magentoAppIsolation enabled
53+
* @magentoDataFixture Magento/Review/_files/disable_config.php
54+
* @magentoDataFixture Magento/Catalog/_files/products.php
55+
*/
56+
public function testAttemptForGuestToAddReview()
57+
{
58+
$product = $this->getProduct();
59+
/** @var FormKey $formKey */
60+
$formKey = $this->_objectManager->get(FormKey::class);
61+
$post = [
62+
'nickname' => 'Test nick',
63+
'title' => 'Summary',
64+
'detail' => 'Test Details',
65+
'form_key' => $formKey->getFormKey(),
66+
];
67+
68+
$this->prepareRequestData($post);
69+
$this->dispatch('review/product/post/id/' . $product->getId());
70+
71+
$this->assertRedirect($this->stringContains('customer/account/login'));
72+
}
73+
74+
/**
75+
* Test successfully adding a product review by a guest
76+
*
77+
* @magentoDbIsolation enabled
78+
* @magentoAppIsolation enabled
79+
* @magentoDataFixture Magento/Review/_files/config.php
80+
* @magentoDataFixture Magento/Catalog/_files/products.php
81+
*/
82+
public function testSuccessfullyAddingProductReviewForGuest()
83+
{
84+
$product = $this->getProduct();
85+
/** @var FormKey $formKey */
86+
$formKey = $this->_objectManager->get(FormKey::class);
87+
$post = [
88+
'nickname' => 'Test nick',
89+
'title' => 'Summary',
90+
'detail' => 'Test Details',
91+
'form_key' => $formKey->getFormKey(),
92+
];
93+
94+
$this->prepareRequestData($post);
95+
$this->dispatch('review/product/post/id/' . $product->getId());
96+
97+
$this->assertSessionMessages(
98+
$this->equalTo(['You submitted your review for moderation.']),
99+
MessageInterface::TYPE_SUCCESS
100+
);
101+
}
102+
103+
/**
104+
* @return ProductInterface
105+
*/
106+
private function getProduct()
107+
{
108+
return $this->_objectManager->get(ProductRepositoryInterface::class)->get('custom-design-simple-product');
109+
}
110+
111+
/**
112+
* @param array $postData
113+
* @return void
114+
*/
115+
private function prepareRequestData($postData)
116+
{
117+
$this->getRequest()->setMethod(Request::METHOD_POST);
118+
$this->getRequest()->setPostValue($postData);
119+
}
120+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/** @var Value $config */
8+
use Magento\Framework\App\Config\Value;
9+
10+
$config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(Value::class);
11+
$config->setPath('catalog/review/allow_guest');
12+
$config->setScope('default');
13+
$config->setScopeId(0);
14+
$config->setValue(0);
15+
$config->save();

0 commit comments

Comments
 (0)