Skip to content

Commit 60a4372

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #13716: Category\Collection::joinUrlRewrite should use the store set on the collection (by @alepane21) - #14317: FR#7428 - Multiline fields in forms have no visible label (by @crisdiaz) - #14358: Format code (by @mageprince) - #14230: Fix for broken navigation menu on IE11 (by @cstergianos) - #14303: Resolves PHPdoc issue in ticket #13992 (by @cream-julian) - #14306: [#14089] Add Malaysian Locale Code (by @osrecio) Fixed GitHub Issues: - #13704: Category\Collection::joinUrlRewrite should use the store set on the collection (reported by @alepane21) has been fixed in #13716 by @alepane21 in 2.2-develop branch Related commits: 1. fc73ae2 2. 8ec6e05 3. 0241a1c 4. 3320fec 5. c3ea127 6. eb04ab0 - #7428: Multiline fields in forms have no visible label (reported by @navarr) has been fixed in #14317 by @crisdiaz in 2.2-develop branch Related commits: 1. d1ea17d - #13992: Incorrect phpdoc should be Shipment\Item not Invoice\Item (reported by @ThisIsRuddy) has been fixed in #14303 by @cream-julian in 2.2-develop branch Related commits: 1. 564ab99 - #14089: Malaysian (Malaysia) missing from locale list (reported by @superdav42) has been fixed in #14306 by @osrecio in 2.2-develop branch Related commits: 1. 1cd6d1b
2 parents 897deca + db490b5 commit 60a4372

File tree

9 files changed

+175
-4
lines changed

9 files changed

+175
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function joinUrlRewrite()
313313
['request_path'],
314314
sprintf(
315315
'{{table}}.is_autogenerated = 1 AND {{table}}.store_id = %d AND {{table}}.entity_type = \'%s\'',
316-
$this->_storeManager->getStore()->getId(),
316+
$this->getStoreId(),
317317
CategoryUrlRewriteGenerator::ENTITY_TYPE
318318
),
319319
'left'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Test\Unit\Model\ResourceModel\Category\Collection;
8+
9+
class UrlRewriteTest extends \PHPUnit\Framework\TestCase
10+
{
11+
/**
12+
* @var \PHPUnit_Framework_MockObject_MockObject
13+
*/
14+
private $model;
15+
16+
protected function setUp()
17+
{
18+
$this->model = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Category\Collection::class)
19+
->disableOriginalConstructor()
20+
->setMethodsExcept(['joinUrlRewrite', 'setStoreId', 'getStoreId'])
21+
->getMock();
22+
}
23+
24+
public function testStoreIdUsedByUrlRewrite()
25+
{
26+
$cond = '{{table}}.is_autogenerated = 1 AND {{table}}.store_id = 100 AND {{table}}.entity_type = \'category\'';
27+
$this->model->expects($this->once())
28+
->method('joinTable')
29+
->with(
30+
$this->anything(),
31+
$this->anything(),
32+
$this->anything(),
33+
$this->equalTo($cond),
34+
$this->anything()
35+
);
36+
$this->model->setStoreId(100);
37+
$this->model->joinUrlRewrite();
38+
}
39+
}

app/code/Magento/Review/etc/adminhtml/menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<menu>
1010
<add id="Magento_Review::catalog_reviews_ratings_ratings" title="Rating" translate="title" module="Magento_Review" sortOrder="60" parent="Magento_Backend::stores_attributes" action="review/rating/" resource="Magento_Review::ratings"/>
1111
<add id="Magento_Review::catalog_reviews_ratings_reviews_all" title="Reviews" translate="title" module="Magento_Review" parent="Magento_Backend::marketing_user_content" sortOrder="10" action="review/product/index" resource="Magento_Review::reviews_all"/>
12-
<add id="Magento_Review::report_review" title="Reviews" translate="title" module="Magento_Reports" sortOrder="20" parent="Magento_Reports::report" resource="Magento_Reports::review"/>
12+
<add id="Magento_Review::report_review" title="Reviews" translate="title" module="Magento_Reports" sortOrder="20" parent="Magento_Reports::report" resource="Magento_Reports::review"/>
1313
<add id="Magento_Review::report_review_customer" title="By Customers" translate="title" sortOrder="10" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/customer" resource="Magento_Reports::review_customer"/>
1414
<add id="Magento_Review::report_review_product" title="By Products" translate="title" sortOrder="20" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/product" resource="Magento_Reports::review_product"/>
1515
</menu>

app/code/Magento/Sales/Model/Order/Shipment/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function getOrderItem()
146146
* Declare qty
147147
*
148148
* @param float $qty
149-
* @return \Magento\Sales\Model\Order\Invoice\Item
149+
* @return \Magento\Sales\Model\Order\Shipment\Item
150150
* @throws \Magento\Framework\Exception\LocalizedException
151151
*/
152152
public function setQty($qty)

app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
// Hide group legend and show first field label instead
280280
legend {
281281
&.admin__field-label {
282-
opacity: 0;
282+
opacity: 1;
283283
}
284284
}
285285

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Catalog\Model\ResourceModel\Category;
7+
8+
class CollectionTest extends \PHPUnit\Framework\TestCase
9+
{
10+
/**
11+
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection
12+
*/
13+
private $collection;
14+
15+
/**
16+
* Sets up the fixture, for example, opens a network connection.
17+
* This method is called before a test is executed.
18+
*/
19+
protected function setUp()
20+
{
21+
$this->collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
22+
\Magento\Catalog\Model\ResourceModel\Category\Collection::class
23+
);
24+
}
25+
26+
protected function setDown()
27+
{
28+
/* Refresh stores memory cache after store deletion */
29+
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
30+
\Magento\Store\Model\StoreManagerInterface::class
31+
)->reinitStores();
32+
}
33+
34+
/**
35+
* @magentoAppIsolation enabled
36+
* @magentoDbIsolation enabled
37+
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php
38+
*/
39+
public function testJoinUrlRewriteOnDefault()
40+
{
41+
$categories = $this->collection->joinUrlRewrite()->addPathFilter('1/2/3');
42+
$this->assertCount(1, $categories);
43+
/** @var $category \Magento\Catalog\Model\Category */
44+
$category = $categories->getFirstItem();
45+
$this->assertStringEndsWith('category.html', $category->getUrl());
46+
}
47+
48+
/**
49+
* @magentoAppIsolation enabled
50+
* @magentoDbIsolation enabled
51+
* @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php
52+
*/
53+
public function testJoinUrlRewriteNotOnDefaultStore()
54+
{
55+
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
56+
->create(\Magento\Store\Model\Store::class);
57+
$storeId = $store->load('second_category_store', 'code')->getId();
58+
$categories = $this->collection->setStoreId($storeId)->joinUrlRewrite()->addPathFilter('1/2/3');
59+
$this->assertCount(1, $categories);
60+
/** @var $category \Magento\Catalog\Model\Category */
61+
$category = $categories->getFirstItem();
62+
$this->assertStringEndsWith('category-3-on-2.html', $category->getUrl());
63+
}
64+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/** @var \Magento\Catalog\Model\CategoryFactory $factory */
8+
$factory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
9+
\Magento\Catalog\Model\CategoryFactory::class
10+
);
11+
/** @var \Magento\Catalog\Model\CategoryRepository $repository */
12+
$repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
13+
\Magento\Catalog\Model\CategoryRepository::class
14+
);
15+
/** @var \Magento\Store\Model\StoreManagerInterface $storeManager */
16+
$storeManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
17+
\Magento\Store\Model\StoreManagerInterface::class
18+
);
19+
/** @var \Magento\Store\Model\Store $store */
20+
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class);
21+
if (!$store->load('second_category_store', 'code')->getId()) {
22+
$websiteId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
23+
\Magento\Store\Model\StoreManagerInterface::class
24+
)->getWebsite()->getId();
25+
$groupId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
26+
\Magento\Store\Model\StoreManagerInterface::class
27+
)->getWebsite()->getDefaultGroupId();
28+
29+
$store->setCode(
30+
'second_category_store'
31+
)->setWebsiteId(
32+
$websiteId
33+
)->setGroupId(
34+
$groupId
35+
)->setName(
36+
'Fixture Store'
37+
)->setSortOrder(
38+
10
39+
)->setIsActive(
40+
1
41+
);
42+
$store->save();
43+
}
44+
45+
/* Refresh stores memory cache */
46+
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
47+
\Magento\Store\Model\StoreManagerInterface::class
48+
)->reinitStores();
49+
50+
/** @var \Magento\Catalog\Model\Category $newCategory */
51+
$newCategory = $factory->create();
52+
$newCategory
53+
->setName('Category')
54+
->setParentId(2)
55+
->setLevel(2)
56+
->setPath('1/2/3')
57+
->setAvailableSortBy('name')
58+
->setDefaultSortBy('name')
59+
->setIsActive(true)
60+
->setPosition(1);
61+
$repository->save($newCategory);
62+
$currentStoreId = $storeManager->getStore()->getId();
63+
$storeManager->setCurrentStore($storeManager->getStore($store->getId()));
64+
$newCategory->setUrlKey('category-3-on-2');
65+
$repository->save($newCategory);
66+
$storeManager->setCurrentStore($storeManager->getStore($currentStoreId));

lib/internal/Magento/Framework/Locale/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface
7575
'mk_MK', /*Macedonian (Macedonia)*/
7676
'mn_Cyrl_MN', /*Mongolian (Mongolia)*/
7777
'ms_Latn_MY', /*Malaysian (Malaysia)*/
78+
'ms_MY', /*Malaysian (Malaysia)*/
7879
'nl_BE', /*Dutch (Belgium)*/
7980
'nl_NL', /*Dutch (Netherlands)*/
8081
'nb_NO', /*Norwegian BokmГ_l (Norway)*/

lib/web/css/source/lib/_navigation.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
.lib-css(text-decoration, @_nav-level0-item-text-decoration);
325325
box-sizing: border-box;
326326
position: relative;
327+
display: inline-block;
327328

328329
&:hover, &.ui-state-focus {
329330
.lib-css(background, @_nav-level0-item-background-color-hover);

0 commit comments

Comments
 (0)