Skip to content

Commit 298d42d

Browse files
committed
Merge branch '2.4-develop' into L3_PR_21-10-10
2 parents 58a90cf + e1d24f3 commit 298d42d

File tree

48 files changed

+920
-258
lines changed

Some content is hidden

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

48 files changed

+920
-258
lines changed

app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-94176"/>
1919
<group value="backup"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Magento backup functionality is deprecated</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<magentoCLI command="config:set {{EnableBackupFunctionality.path}} {{EnableBackupFunctionality.value}}" stepKey="setEnableBackup"/>

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
class Renderer extends \Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer
2020
{
2121
/**
22-
* Serializer
23-
*
2422
* @var Json
2523
*/
2624
private $serializer;
@@ -211,7 +209,7 @@ public function getValueHtml($item)
211209
if (!$this->isChildCalculated($item)) {
212210
$attributes = $this->getSelectionAttributes($item);
213211
if ($attributes) {
214-
$result .= " " . $this->getItem()->getOrder()->formatPrice($attributes['price']);
212+
$result .= " " . $this->getItem()->getOrder()->formatBasePrice($attributes['price']);
215213
}
216214
}
217215
return $result;

app/code/Magento/Bundle/Block/Sales/Order/Items/Renderer.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
class Renderer extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer
1717
{
1818
/**
19-
* Serializer
20-
*
2119
* @var Json
2220
*/
2321
private $serializer;
@@ -43,7 +41,10 @@ public function __construct(
4341
}
4442

4543
/**
44+
* Check if shipment type (invoice etc) is separate
45+
*
4646
* @param mixed $item
47+
*
4748
* @return bool
4849
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
4950
*/
@@ -79,7 +80,10 @@ public function isShipmentSeparately($item = null)
7980
}
8081

8182
/**
83+
* Check if sub product calculations are present
84+
*
8285
* @param mixed $item
86+
*
8387
* @return bool
8488
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8589
*/
@@ -117,7 +121,10 @@ public function isChildCalculated($item = null)
117121
}
118122

119123
/**
124+
* Get bundle selection attributes
125+
*
120126
* @param mixed $item
127+
*
121128
* @return mixed|null
122129
*/
123130
public function getSelectionAttributes($item)
@@ -134,14 +141,17 @@ public function getSelectionAttributes($item)
134141
}
135142

136143
/**
144+
* Get html of bundle selection attributes
145+
*
137146
* @param mixed $item
147+
*
138148
* @return string
139149
*/
140150
public function getValueHtml($item)
141151
{
142152
if ($attributes = $this->getSelectionAttributes($item)) {
143153
return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . " "
144-
. $this->getOrder()->formatPrice($attributes['price']);
154+
. $this->getOrder()->formatBasePrice($attributes['price']);
145155
}
146156
return $this->escapeHtml($item->getName());
147157
}
@@ -183,7 +193,10 @@ public function getChildren($item)
183193
}
184194

185195
/**
196+
* Check if price info can be shown
197+
*
186198
* @param mixed $item
199+
*
187200
* @return bool
188201
*/
189202
public function canShowPriceInfo($item)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToProductAttributeEditPageActionGroup">
12+
<annotations>
13+
<description>Navigate to the given product attribute edit page by attribute label</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="ProductAttributeLabel" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
20+
<fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttributeLabel}}" stepKey="fillTheAttributesFilterByLabel"/>
21+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickTheSearchButton"/>
22+
<waitForPageLoad stepKey="waitForSearchToComplete"/>
23+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnTheFirstSearchResultRow"/>
24+
<waitForPageLoad stepKey="waitForAttribiteEditPageToLoad"/>
25+
</actionGroup>
26+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminScopeSelectionShouldBeDisabledOnMediaGalleryProductAttributeEditTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Attributes Updating"/>
14+
<group value="Catalog"/>
15+
<title value="Admin should not able to change Scope of Media Gallery product attribute"/>
16+
<description value="Admin should not able to change Scope of Media Gallery product attribute"/>
17+
<severity value="MAJOR"/>
18+
<useCaseId value="MC-38156"/>
19+
<testCaseId value="AC-1337"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
26+
</after>
27+
28+
<actionGroup ref="AdminNavigateToProductAttributeEditPageActionGroup" stepKey="navigateToMediaGalleryProductAttribute">
29+
<argument name="ProductAttributeLabel" value="Media Gallery"/>
30+
</actionGroup>
31+
32+
<click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="clickAdvancedAttributePropertiesSectionToggle"/>
33+
34+
<assertElementContainsAttribute stepKey="assertTheScopeSelectionIsDisabled">
35+
<expectedResult selector="{{AdvancedAttributePropertiesSection.Scope}}" attribute="disabled" type="string"></expectedResult>
36+
</assertElementContainsAttribute>
37+
38+
</test>
39+
</tests>
40+

app/code/Magento/CompareListGraphQl/Model/Service/Collection/GetComparableItemsCollection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ public function execute(int $listId, ContextInterface $context): Collection
7878
$this->items->useProductItem()->setStoreId($context->getExtensionAttributes()->getStore()->getStoreId());
7979
$this->items->addAttributeToSelect(
8080
$this->catalogConfig->getProductAttributes()
81-
)->loadComparableAttributes()->addMinimalPrice()->addTaxPercents()->setVisibility(
82-
$this->catalogProductVisibility->getVisibleInSiteIds()
83-
);
81+
)->loadComparableAttributes()->addMinimalPrice()->addTaxPercents();
8482

8583
return $this->items;
8684
}

app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
class Alert extends \Magento\Framework\App\Config\Value
1818
{
1919
/**
20-
* Cron string path
20+
* Cron expression config path
2121
*/
2222
const CRON_STRING_PATH = 'crontab/default/jobs/catalog_product_alert/schedule/cron_expr';
2323

2424
/**
25-
* Cron model path
25+
* Cron model config path
2626
*/
2727
const CRON_MODEL_PATH = 'crontab/default/jobs/catalog_product_alert/run/model';
2828

@@ -71,8 +71,16 @@ public function __construct(
7171
*/
7272
public function afterSave()
7373
{
74-
$time = $this->getData('groups/productalert_cron/fields/time/value');
75-
$frequency = $this->getData('groups/productalert_cron/fields/frequency/value');
74+
$time = $this->getData('groups/productalert_cron/fields/time/value') ?:
75+
explode(
76+
',',
77+
$this->_config->getValue(
78+
'catalog/productalert_cron/time',
79+
$this->getScope(),
80+
$this->getScopeId()
81+
) ?: '0,0,0'
82+
);
83+
$frequency = $this->getValue();
7684

7785
$cronExprArray = [
7886
(int)$time[1], //Minute
@@ -102,6 +110,7 @@ public function afterSave()
102110
self::CRON_MODEL_PATH
103111
)->save();
104112
} catch (\Exception $e) {
113+
// phpcs:ignore Magento2.Exceptions.DirectThrow
105114
throw new \Exception(__('We can\'t save the cron expression.'));
106115
}
107116

app/code/Magento/Customer/Model/Address/CustomerAddressDataProvider.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
namespace Magento\Customer\Model\Address;
99

10+
use Magento\Customer\Model\Config\Share;
11+
use Magento\Directory\Model\AllowedCountries;
12+
use Magento\Framework\App\ObjectManager;
13+
1014
/**
1115
* Provides customer address data.
1216
*/
@@ -24,13 +28,31 @@ class CustomerAddressDataProvider
2428
*/
2529
private $customerAddressDataFormatter;
2630

31+
/**
32+
* @var \Magento\Customer\Model\Config\Share
33+
*/
34+
private $shareConfig;
35+
36+
/**
37+
* @var AllowedCountries
38+
*/
39+
private $allowedCountryReader;
40+
2741
/**
2842
* @param CustomerAddressDataFormatter $customerAddressDataFormatter
43+
* @param Share|null $share
44+
* @param AllowedCountries|null $allowedCountryReader
2945
*/
3046
public function __construct(
31-
CustomerAddressDataFormatter $customerAddressDataFormatter
47+
CustomerAddressDataFormatter $customerAddressDataFormatter,
48+
?Share $share = null,
49+
?AllowedCountries $allowedCountryReader = null
3250
) {
3351
$this->customerAddressDataFormatter = $customerAddressDataFormatter;
52+
$this->shareConfig = $share ?: ObjectManager::getInstance()
53+
->get(Share::class);
54+
$this->allowedCountryReader = $allowedCountryReader ?: ObjectManager::getInstance()
55+
->get(AllowedCountries::class);
3456
}
3557

3658
/**
@@ -52,8 +74,14 @@ public function getAddressDataByCustomer(
5274
return [];
5375
}
5476

77+
$allowedCountries = $this->allowedCountryReader->getAllowedCountries();
5578
$customerAddresses = [];
5679
foreach ($customerOriginAddresses as $address) {
80+
// Checks if a country id present in the allowed countries list.
81+
if ($this->shareConfig->isGlobalScope() && !in_array($address->getCountryId(), $allowedCountries)) {
82+
continue;
83+
}
84+
5785
$customerAddresses[$address->getId()] = $this->customerAddressDataFormatter->prepareAddress($address);
5886
}
5987

app/code/Magento/Customer/Model/Plugin/AllowedCountries.php

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)