Skip to content

Commit 628061f

Browse files
authored
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #13052: Make "top destinations" config field configurable on store level (by @avstudnitz) - #13019: [Backport to 2.2-develop] Attribute with "Catalog Input Type for Store Owner" equal "Fixed Product Tax" for Multi-store (by @dverkade) - #12649: #12446: Add GetUtilityPageIdentifiers for Manage Custom Pages to be excluded … (by @osrecio) - #12922: Handle multiple errors in customer address validation when shown in adminhtml customer edit page (by @adrian-martinez-interactiv4) - #12917: Fix issue 12894: Can't remove State is required for all countries (by @vasilii-b) Fixed GitHub Issues: - #12393: Attribute with "Catalog Input Type for Store Owner" equal "Fixed Product Tax" for Multi-store (reported by @klakovskiy) has been fixed in #13019 by @dverkade in 2.2-develop branch Related commits: 1. 13546a7 - #12446: Remove /home from the sitemap.xml (reported by @wd7080) has been fixed in #12649 by @osrecio in 2.2-develop branch Related commits: 1. 6ea1c43 - #12894: Can't remove State is required for all countries (reported by @mazur-vlad) has been fixed in #12917 by @vasilii-b in 2.2-develop branch Related commits: 1. 4f91566
2 parents b09ab2a + 0a49e20 commit 628061f

File tree

9 files changed

+118
-16
lines changed

9 files changed

+118
-16
lines changed

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
<label>European Union Countries</label>
216216
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
217217
</field>
218-
<field id="destinations" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">
218+
<field id="destinations" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
219219
<label>Top destinations</label>
220220
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
221221
</field>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Cms\Api;
7+
8+
/**
9+
* Utility Cms Pages
10+
*
11+
* @api
12+
*/
13+
interface GetUtilityPageIdentifiersInterface
14+
{
15+
/**
16+
* Get List Page Identifiers
17+
* @return array
18+
*/
19+
public function execute();
20+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Cms\Model;
7+
8+
use Magento\Cms\Api\GetUtilityPageIdentifiersInterface;
9+
use Magento\Framework\App\Config\ScopeConfigInterface;
10+
use Magento\Store\Model\ScopeInterface;
11+
12+
/**
13+
* Utility Cms Pages
14+
*/
15+
class GetUtilityPageIdentifiers implements GetUtilityPageIdentifiersInterface
16+
{
17+
/**
18+
* @var ScopeConfigInterface
19+
*/
20+
private $scopeConfig;
21+
22+
/**
23+
* UtilityCmsPage constructor.
24+
* @param ScopeConfigInterface $scopeConfig
25+
*/
26+
public function __construct(
27+
ScopeConfigInterface $scopeConfig
28+
) {
29+
$this->scopeConfig = $scopeConfig;
30+
}
31+
32+
/**
33+
* Get List Page Identifiers
34+
* @return array
35+
*/
36+
public function execute()
37+
{
38+
$homePageIdentifier = $this->scopeConfig->getValue(
39+
'web/default/cms_home_page',
40+
ScopeInterface::SCOPE_STORE
41+
);
42+
$noRouteIdentifier = $this->scopeConfig->getValue(
43+
'web/default/cms_no_route',
44+
ScopeInterface::SCOPE_STORE
45+
);
46+
47+
$noCookieIdentifier = $this->scopeConfig->getValue(
48+
'web/default/cms_no_cookies',
49+
ScopeInterface::SCOPE_STORE
50+
);
51+
52+
return [$homePageIdentifier, $noRouteIdentifier, $noCookieIdentifier];
53+
}
54+
}

app/code/Magento/Cms/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<preference for="Magento\Cms\Api\Data\BlockInterface" type="Magento\Cms\Model\Block" />
1515
<preference for="Magento\Cms\Api\BlockRepositoryInterface" type="Magento\Cms\Model\BlockRepository" />
1616
<preference for="Magento\Cms\Api\PageRepositoryInterface" type="Magento\Cms\Model\PageRepository" />
17+
<preference for="Magento\Cms\Api\GetUtilityPageIdentifiersInterface" type="Magento\Cms\Model\GetUtilityPageIdentifiers" />
1718
<type name="Magento\Cms\Model\Wysiwyg\Config">
1819
<arguments>
1920
<argument name="windowSize" xsi:type="array">

app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\Customer\Model\Metadata\Form;
1414
use Magento\Framework\Exception\LocalizedException;
1515

16+
/**
17+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
*/
1619
class Save extends \Magento\Customer\Controller\Adminhtml\Index
1720
{
1821
/**
@@ -268,6 +271,15 @@ public function execute()
268271
$this->_addSessionErrorMessages($messages);
269272
$this->_getSession()->setCustomerFormData($originalRequestData);
270273
$returnToEdit = true;
274+
} catch (\Magento\Framework\Exception\AbstractAggregateException $exception) {
275+
$errors = $exception->getErrors();
276+
$messages = [];
277+
foreach ($errors as $error) {
278+
$messages[] = $error->getMessage();
279+
}
280+
$this->_addSessionErrorMessages($messages);
281+
$this->_getSession()->setCustomerFormData($originalRequestData);
282+
$returnToEdit = true;
271283
} catch (LocalizedException $exception) {
272284
$this->_addSessionErrorMessages($exception->getMessage());
273285
$this->_getSession()->setCustomerFormData($originalRequestData);

app/code/Magento/Directory/etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
<field id="state_required" translate="label" type="multiselect" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
110110
<label>State is Required for</label>
111111
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
112+
<can_be_empty>1</can_be_empty>
112113
</field>
113114
<field id="display_all" translate="label" type="select" sortOrder="8" showInDefault="1" showInWebsite="0" showInStore="0">
114115
<label>Allow to Choose State if It is Optional for Country</label>

app/code/Magento/Sitemap/Model/ResourceModel/Cms/Page.php

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@
66
namespace Magento\Sitemap\Model\ResourceModel\Cms;
77

88
use Magento\Cms\Api\Data\PageInterface;
9-
use Magento\Framework\EntityManager\MetadataPool;
10-
use Magento\Framework\Model\ResourceModel\Db\Context;
11-
use Magento\Framework\Model\AbstractModel;
9+
use Magento\Cms\Api\GetUtilityPageIdentifiersInterface;
1210
use Magento\Cms\Model\Page as CmsPage;
11+
use Magento\Framework\App\ObjectManager;
1312
use Magento\Framework\DB\Select;
1413
use Magento\Framework\EntityManager\EntityManager;
14+
use Magento\Framework\EntityManager\MetadataPool;
15+
use Magento\Framework\Model\AbstractModel;
16+
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
17+
use Magento\Framework\Model\ResourceModel\Db\Context;
1518

1619
/**
1720
* Sitemap cms page collection model
1821
*
1922
* @api
2023
* @since 100.0.2
2124
*/
22-
class Page extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
25+
class Page extends AbstractDb
2326
{
2427
/**
2528
* @var MetadataPool
@@ -34,19 +37,29 @@ class Page extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
3437
protected $entityManager;
3538

3639
/**
37-
* @param Context $context
38-
* @param MetadataPool $metadataPool
39-
* @param EntityManager $entityManager
40-
* @param string $connectionName
40+
* @var GetUtilityPageIdentifiersInterface
41+
* @since 100.2.0
42+
*/
43+
private $getUtilityPageIdentifiers;
44+
45+
/**
46+
* @param Context $context
47+
* @param MetadataPool $metadataPool
48+
* @param EntityManager $entityManager
49+
* @param string $connectionName
50+
* @param GetUtilityPageIdentifiersInterface $getUtilityPageIdentifiers
4151
*/
4252
public function __construct(
4353
Context $context,
4454
MetadataPool $metadataPool,
4555
EntityManager $entityManager,
46-
$connectionName = null
56+
$connectionName = null,
57+
GetUtilityPageIdentifiersInterface $getUtilityPageIdentifiers = null
4758
) {
48-
$this->metadataPool = $metadataPool;
49-
$this->entityManager = $entityManager;
59+
$this->metadataPool = $metadataPool;
60+
$this->entityManager = $entityManager;
61+
$this->getUtilityPageIdentifiers = $getUtilityPageIdentifiers ?:
62+
ObjectManager::getInstance()->get(GetUtilityPageIdentifiersInterface::class);
5063
parent::__construct($context, $connectionName);
5164
}
5265

@@ -90,8 +103,8 @@ public function getCollection($storeId)
90103
)->where(
91104
'main_table.is_active = 1'
92105
)->where(
93-
'main_table.identifier != ?',
94-
\Magento\Cms\Model\Page::NOROUTE_PAGE_ID
106+
'main_table.identifier NOT IN (?)',
107+
$this->getUtilityPageIdentifiers->execute()
95108
)->where(
96109
'store_table.store_id IN(?)',
97110
[0, $storeId]

app/code/Magento/Sitemap/etc/module.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<module name="Magento_Sitemap" setup_version="2.0.0">
1010
<sequence>
1111
<module name="Magento_Robots"/>
12+
<module name="Magento_Cms"/>
1213
<module name="Magento_Catalog"/>
1314
</sequence>
1415
</module>

app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Manager/Website.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function getWebsites(ProductInterface $product, EavAttribute $eavAttribut
6868
if ($storeId = $this->locator->getStore()->getId()) {
6969
/** @var WebsiteInterface $website */
7070
$website = $this->storeManager->getStore($storeId)->getWebsite();
71-
$websites[$website->getId()] = [
71+
$websites[] = [
7272
'value' => $website->getId(),
7373
'label' => $this->formatLabel(
7474
$website->getName(),
@@ -81,7 +81,7 @@ public function getWebsites(ProductInterface $product, EavAttribute $eavAttribut
8181
if (!in_array($website->getId(), $product->getWebsiteIds())) {
8282
continue;
8383
}
84-
$websites[$website->getId()] = [
84+
$websites[] = [
8585
'value' => $website->getId(),
8686
'label' => $this->formatLabel(
8787
$website->getName(),

0 commit comments

Comments
 (0)