Skip to content

Commit cc65b99

Browse files
authored
1.1.28 Release (#115)
* 1.1.28 Release - Added patches for 1.1.28 release - Removed accidently added patch from previous release (ACSD-48813) - Updated magento_releases.json * 1.1.28 Release - Fixed issue with ACSD-49065 patch - Updated patches-info.json * 1.1.28 Release - Fixed issue with ACSD-49065 patch * 1.1.28 Release - Reverted changes to MDVA-41139 patch * 1.1.28 Release - Reverted changes to magento_releases.json (it was added along with a new releases in a separate PR) * 1.1.28 Release - Fixed typo
1 parent 4858fc3 commit cc65b99

17 files changed

+1394
-22
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/quality-patches",
33
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
44
"type": "magento2-component",
5-
"version": "1.1.27",
5+
"version": "1.1.28",
66
"license": "proprietary",
77
"repositories": {
88
"repo": {

patches-info.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
diff --git a/vendor/magento/module-gift-card/Model/Catalog/Product/Price/Giftcard.php b/vendor/magento/module-gift-card/Model/Catalog/Product/Price/Giftcard.php
2+
index 8988bd8eb02..aa8c589f54d 100644
3+
--- a/vendor/magento/module-gift-card/Model/Catalog/Product/Price/Giftcard.php
4+
+++ b/vendor/magento/module-gift-card/Model/Catalog/Product/Price/Giftcard.php
5+
@@ -5,12 +5,20 @@
6+
*/
7+
namespace Magento\GiftCard\Model\Catalog\Product\Price;
8+
9+
-class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
10+
+use Magento\Catalog\Model\Product;
11+
+use Magento\Catalog\Model\Product\Type\Price;
12+
+use Magento\Store\Model\StoreManagerInterface;
13+
+use Magento\GiftCard\Model\Catalog\Product\Type\Giftcard as GiftCardType;
14+
+
15+
+/**
16+
+ * Gift card product type price model
17+
+ *
18+
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
19+
+ */
20+
+class Giftcard extends Price
21+
{
22+
/**
23+
- * Store manager
24+
- *
25+
- * @var \Magento\Store\Model\StoreManagerInterface
26+
+ * @var StoreManagerInterface
27+
*/
28+
protected $_storeManager;
29+
30+
@@ -29,7 +37,7 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
31+
/**
32+
* Return price of the specified product
33+
*
34+
- * @param \Magento\Catalog\Model\Product $product
35+
+ * @param Product $product
36+
* @return float
37+
*/
38+
public function getPrice($product)
39+
@@ -52,27 +60,14 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
40+
* Retrieve product final price
41+
*
42+
* @param int $qty
43+
- * @param \Magento\Catalog\Model\Product $product
44+
+ * @param Product $product
45+
* @return float
46+
*/
47+
public function getFinalPrice($qty, $product)
48+
{
49+
$finalPrice = $product->getPrice();
50+
if ($product->hasCustomOptions()) {
51+
- $customOption = $product->getCustomOption('giftcard_amount');
52+
- if ($customOption) {
53+
- $amounts = $product->getGiftcardAmounts();
54+
- if (!empty($amounts) && count($amounts) === 1) {
55+
- $optionValue = $product->getGiftcardAmounts()[0]['value'];
56+
- if ($optionValue !== $customOption->getValue()) {
57+
- $finalPrice += $optionValue;
58+
- } else {
59+
- $finalPrice += $customOption->getValue();
60+
- }
61+
- } else {
62+
- $finalPrice += $customOption->getValue();
63+
- }
64+
- }
65+
+ $finalPrice = $this->getFinalPriceWithCustomOptions($product, $finalPrice);
66+
}
67+
$finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);
68+
69+
@@ -83,7 +78,7 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
70+
/**
71+
* Load and set gift card amounts into product object
72+
*
73+
- * @param \Magento\Catalog\Model\Product $product
74+
+ * @param Product $product
75+
* @return array
76+
*/
77+
public function getAmounts($product)
78+
@@ -97,13 +92,13 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
79+
}
80+
}
81+
82+
- return $prices ? $prices : [];
83+
+ return $prices ?: [];
84+
}
85+
86+
/**
87+
* Return minimal amount for Giftcard product
88+
*
89+
- * @param \Magento\Catalog\Model\Product $product
90+
+ * @param Product $product
91+
* @return float
92+
*/
93+
public function getMinAmount($product)
94+
@@ -115,7 +110,7 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
95+
/**
96+
* Return maximal amount for Giftcard product
97+
*
98+
- * @param \Magento\Catalog\Model\Product $product
99+
+ * @param Product $product
100+
* @return float
101+
*/
102+
public function getMaxAmount($product)
103+
@@ -127,7 +122,7 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
104+
/**
105+
* Fill in $_amountCache or return precalculated sorted values for amounts
106+
*
107+
- * @param \Magento\Catalog\Model\Product $product
108+
+ * @param Product $product
109+
* @return array
110+
*/
111+
public function getSortedAmounts($product)
112+
@@ -150,7 +145,7 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
113+
/**
114+
* Fill in $_minMaxCache or return precalculated values for min, max
115+
*
116+
- * @param \Magento\Catalog\Model\Product $product
117+
+ * @param Product $product
118+
* @return array
119+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
120+
*/
121+
@@ -194,4 +189,35 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\Price
122+
}
123+
return $this->_minMaxCache[$product->getId()];
124+
}
125+
+
126+
+ /**
127+
+ * Retrieve product final price with custom options
128+
+ *
129+
+ * @param Product $product
130+
+ * @param float $finalPrice
131+
+ * @return mixed
132+
+ */
133+
+ private function getFinalPriceWithCustomOptions(Product $product, $finalPrice)
134+
+ {
135+
+ $customOption = $product->getCustomOption('giftcard_amount');
136+
+ $isCustomGiftCard = $product->getCustomOption(GiftCardType::GIFTCARD_AMOUNT_IS_CUSTOM);
137+
+ if ($customOption) {
138+
+ $amounts = $product->getGiftcardAmounts();
139+
+ if (!empty($amounts) && count($amounts) === 1) {
140+
+ $optionValue = $product->getGiftcardAmounts()[0]['value'];
141+
+ if ($isCustomGiftCard && $isCustomGiftCard->getValue()) {
142+
+ $finalPrice += $customOption->getValue();
143+
+ } else {
144+
+ if ($optionValue !== $customOption->getValue()) {
145+
+ $finalPrice += $optionValue;
146+
+ } else {
147+
+ $finalPrice += $customOption->getValue();
148+
+ }
149+
+ }
150+
+ } else {
151+
+ $finalPrice += $customOption->getValue();
152+
+ }
153+
+ }
154+
+ return $finalPrice;
155+
+ }
156+
}
157+
diff --git a/vendor/magento/module-gift-card/Model/Catalog/Product/Type/Giftcard.php b/vendor/magento/module-gift-card/Model/Catalog/Product/Type/Giftcard.php
158+
index 9e4f4245595..cb58f914acb 100644
159+
--- a/vendor/magento/module-gift-card/Model/Catalog/Product/Type/Giftcard.php
160+
+++ b/vendor/magento/module-gift-card/Model/Catalog/Product/Type/Giftcard.php
161+
@@ -17,7 +17,9 @@ use Magento\Store\Model\Store;
162+
*/
163+
class Giftcard extends \Magento\Catalog\Model\Product\Type\AbstractType
164+
{
165+
- const TYPE_GIFTCARD = 'giftcard';
166+
+ public const TYPE_GIFTCARD = 'giftcard';
167+
+
168+
+ public const GIFTCARD_AMOUNT_IS_CUSTOM = 'giftcard_amount_is_custom';
169+
170+
/**
171+
* Whether product quantity is fractional number or not
172+
@@ -228,6 +230,12 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\AbstractType
173+
$product->addCustomOption('giftcard_recipient_email', $buyRequest->getGiftcardRecipientEmail(), $product);
174+
}
175+
176+
+ if ($buyRequest->getGiftcardAmount() === 'custom') {
177+
+ $product->addCustomOption(self::GIFTCARD_AMOUNT_IS_CUSTOM, true, $product);
178+
+ } else {
179+
+ $product->addCustomOption(self::GIFTCARD_AMOUNT_IS_CUSTOM, false, $product);
180+
+ }
181+
+
182+
$messageAllowed = false;
183+
if ($product->getUseConfigAllowMessage()) {
184+
$messageAllowed = $this->_scopeConfig->isSetFlag(
185+
@@ -425,6 +433,7 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\AbstractType
186+
$messageAmount = $this->priceCurrency->convertAndFormat($minAmount, false);
187+
throw new \Magento\Framework\Exception\LocalizedException(__('Gift Card min amount is %1', $messageAmount));
188+
}
189+
+ return 0;
190+
}
191+
192+
/**
193+
@@ -539,7 +548,9 @@ class Giftcard extends \Magento\Catalog\Model\Product\Type\AbstractType
194+
* @return void
195+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
196+
*/
197+
+ // @codingStandardsIgnoreStart
198+
public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $product)
199+
{
200+
}
201+
+ // @codingStandardsIgnoreEnd
202+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
diff --git a/vendor/magento/module-gift-card-graph-ql/Model/GiftCardDataProvider.php b/vendor/magento/module-gift-card-graph-ql/Model/GiftCardDataProvider.php
2+
new file mode 100644
3+
index 00000000000..56c67eeab5c
4+
--- /dev/null
5+
+++ b/vendor/magento/module-gift-card-graph-ql/Model/GiftCardDataProvider.php
6+
@@ -0,0 +1,77 @@
7+
+<?php
8+
+/**
9+
+ * Copyright © Magento, Inc. All rights reserved.
10+
+ * See COPYING.txt for license details.
11+
+ */
12+
+declare(strict_types=1);
13+
+
14+
+namespace Magento\GiftCardGraphQl\Model;
15+
+
16+
+use Magento\Framework\Exception\LocalizedException;
17+
+use Magento\QuoteGraphQl\Model\Cart\CreateBuyRequestDataProviderInterface;
18+
+use Magento\GiftCard\Model\Catalog\Product\Type\Giftcard;
19+
+use Magento\GiftCard\Model\Giftcard\Option;
20+
+
21+
+class GiftCardDataProvider implements CreateBuyRequestDataProviderInterface
22+
+{
23+
+ /**
24+
+ * @inheritDoc
25+
+ */
26+
+ public function execute(array $cartItemData): array
27+
+ {
28+
+ $giftCardOptionsData = [];
29+
+
30+
+ foreach ($cartItemData as $uid => $optionValue) {
31+
+ $optionData = explode('/', $uid);
32+
+ if ($this->isProviderApplicable($optionData) === false) {
33+
+ continue;
34+
+ }
35+
+ $this->validateInput($optionData);
36+
+
37+
+ [$optionType, $optionId] = $optionData;
38+
+ if ($optionType === Giftcard::TYPE_GIFTCARD) {
39+
+ if ($optionId === Option::KEY_CUSTOM_GIFTCARD_AMOUNT) {
40+
+ $giftCardOptionsData[Option::KEY_AMOUNT] = 'custom';
41+
+ }
42+
+ $giftCardOptionsData[$optionId] = $optionValue;
43+
+ }
44+
+ }
45+
+
46+
+ return $giftCardOptionsData;
47+
+ }
48+
+
49+
+ /**
50+
+ * Checks whether this provider is applicable for the current option
51+
+ *
52+
+ * @param array $optionData
53+
+ * @return bool
54+
+ */
55+
+ private function isProviderApplicable(array $optionData): bool
56+
+ {
57+
+ return $optionData[0] === Giftcard::TYPE_GIFTCARD
58+
+ && in_array($optionData[1], [
59+
+ Option::KEY_AMOUNT,
60+
+ Option::KEY_CUSTOM_GIFTCARD_AMOUNT,
61+
+ Option::KEY_SENDER_NAME,
62+
+ Option::KEY_SENDER_EMAIL,
63+
+ Option::KEY_RECIPIENT_NAME,
64+
+ Option::KEY_RECIPIENT_EMAIL,
65+
+ Option::KEY_MESSAGE
66+
+ ], true);
67+
+ }
68+
+
69+
+ /**
70+
+ * Validates the provided options structure
71+
+ *
72+
+ * @param array $optionData
73+
+ * @throws LocalizedException
74+
+ */
75+
+ private function validateInput(array $optionData): void
76+
+ {
77+
+ if (count($optionData) !== 2) {
78+
+ throw new LocalizedException(
79+
+ __('Wrong format of the entered option data')
80+
+ );
81+
+ }
82+
+ }
83+
+}
84+
diff --git a/vendor/magento/module-gift-card-graph-ql/etc/graphql/di.xml b/vendor/magento/module-gift-card-graph-ql/etc/graphql/di.xml
85+
index 81b4cc0f6cf..6f9cb929f0b 100644
86+
--- a/vendor/magento/module-gift-card-graph-ql/etc/graphql/di.xml
87+
+++ b/vendor/magento/module-gift-card-graph-ql/etc/graphql/di.xml
88+
@@ -92,4 +92,11 @@
89+
<type name="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface">
90+
<plugin name="additionalFields" type="Magento\GiftCardGraphQl\Model\Plugin\CollectionProcessorInterfacePlugin" />
91+
</type>
92+
+ <type name="Magento\QuoteGraphQl\Model\Cart\CreateBuyRequest">
93+
+ <arguments>
94+
+ <argument name="providers" xsi:type="array">
95+
+ <item name="giftcard_data_provider" xsi:type="object">Magento\GiftCardGraphQl\Model\GiftCardDataProvider</item>
96+
+ </argument>
97+
+ </arguments>
98+
+ </type>
99+
</config>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/vendor/magento/module-bundle/Pricing/Adjustment/DefaultSelectionPriceListProvider.php b/vendor/magento/module-bundle/Pricing/Adjustment/DefaultSelectionPriceListProvider.php
2+
index 297c4659cb87..b2a3f0c6f3c9 100644
3+
--- a/vendor/magento/module-bundle/Pricing/Adjustment/DefaultSelectionPriceListProvider.php
4+
+++ b/vendor/magento/module-bundle/Pricing/Adjustment/DefaultSelectionPriceListProvider.php
5+
@@ -56,8 +56,8 @@ public function getPriceList(Product $bundleProduct, $searchMin, $useRegularPric
6+
[(int)$option->getOptionId()],
7+
$bundleProduct
8+
);
9+
+ $selectionsCollection->setFlag('has_stock_status_filter', true);
10+
$selectionsCollection->removeAttributeToSelect();
11+
- $selectionsCollection->addQuantityFilter();
12+
13+
if (!$useRegularPrice) {
14+
$selectionsCollection->addAttributeToSelect('special_price');
15+
@@ -112,6 +112,9 @@ private function isShouldFindMinOption(Product $bundleProduct, $searchMin)
16+
private function addMiniMaxPriceList(Product $bundleProduct, $selectionsCollection, $searchMin, $useRegularPrice)
17+
{
18+
$selectionsCollection->addPriceFilter($bundleProduct, $searchMin, $useRegularPrice);
19+
+ if ($bundleProduct->isSalable()) {
20+
+ $selectionsCollection->addQuantityFilter();
21+
+ }
22+
$selectionsCollection->setPage(0, 1);
23+
24+
$selection = $selectionsCollection->getFirstItem();

0 commit comments

Comments
 (0)