Skip to content

Commit 4d7fe16

Browse files
authored
Merge pull request #143 from magento-commerce/1.1.39-release
1.1.39 Release
2 parents f1f193f + 04fb33c commit 4d7fe16

21 files changed

+1741
-4
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.38",
5+
"version": "1.1.39",
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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
diff --git a/vendor/magento/module-reward/Model/ResourceModel/Reward/History.php b/vendor/magento/module-reward/Model/ResourceModel/Reward/History.php
2+
index 12e818b..60ea12e 100644
3+
--- a/vendor/magento/module-reward/Model/ResourceModel/Reward/History.php
4+
+++ b/vendor/magento/module-reward/Model/ResourceModel/Reward/History.php
5+
@@ -5,6 +5,7 @@
6+
*/
7+
namespace Magento\Reward\Model\ResourceModel\Reward;
8+
9+
+use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Reward\Model\Reward\History as ModelRewardHistory;
11+
12+
/**
13+
@@ -213,6 +214,7 @@ class History extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
14+
* @param string $expiryType Expiry calculation (static or dynamic)
15+
* @param int $limit Limitation for records expired selection
16+
* @return $this
17+
+ * @throws LocalizedException|\Zend_Db_Statement_Exception
18+
*/
19+
public function expirePoints($websiteId, $expiryType, $limit)
20+
{
21+
@@ -222,8 +224,12 @@ class History extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
22+
23+
$select = $connection->select()->from(
24+
$this->getMainTable()
25+
+ )->joinInner(
26+
+ ['reward' => $this->getTable('magento_reward')],
27+
+ 'reward.reward_id = ' . $this->getMainTable() . '.reward_id',
28+
+ []
29+
)->where(
30+
- 'website_id = :website_id'
31+
+ $this->getMainTable() . '.website_id = :website_id'
32+
)->where(
33+
"{$field} < :time_now"
34+
)->where(
35+
@@ -237,6 +243,10 @@ class History extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
36+
)->limit(
37+
(int)$limit
38+
);
39+
+ $select->columns(
40+
+ [$this->getMainTable() . '.*',
41+
+ 'current_balance' => 'reward.points_balance']
42+
+ );
43+
$bind = [':website_id' => $websiteId, ':time_now' => $now];
44+
$duplicates = [];
45+
$expiredAmounts = [];
46+
@@ -255,8 +265,10 @@ class History extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
47+
}
48+
$expiredAmount = $row['points_delta'] - $row['points_used'];
49+
$row['points_delta'] = -$expiredAmount;
50+
+ $row['points_balance'] = $row['current_balance'] - abs($expiredAmount);
51+
$row['points_used'] = 0;
52+
$expiredAmounts[$row['reward_id']] += $expiredAmount;
53+
+ unset($row['current_balance']);
54+
$duplicates[] = $row;
55+
}
56+
57+
@@ -268,8 +280,8 @@ class History extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
58+
}
59+
$bind = [
60+
'points_balance' => $connection->getCheckSql(
61+
- "points_balance > {$expired}",
62+
- "points_balance-{$expired}",
63+
+ "points_balance > " . abs($expired),
64+
+ "points_balance-" . abs($expired),
65+
0
66+
),
67+
];
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/vendor/magento/module-company-graph-ql/Model/Resolver/UpdateCompanyRole.php b/vendor/magento/module-company-graph-ql/Model/Resolver/UpdateCompanyRole.php
2+
index 5d52f53758..35a1c5c64d 100644
3+
--- a/vendor/magento/module-company-graph-ql/Model/Resolver/UpdateCompanyRole.php
4+
+++ b/vendor/magento/module-company-graph-ql/Model/Resolver/UpdateCompanyRole.php
5+
@@ -13,6 +13,7 @@ use Magento\CompanyGraphQl\Model\Company\Role\PermissionsFormatter;
6+
use Magento\CompanyGraphQl\Model\Company\Role\UpdateRole;
7+
use Magento\Framework\GraphQl\Config\Element\Field;
8+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
9+
+use Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException;
10+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
11+
use Magento\Framework\GraphQl\Query\ResolverInterface;
12+
use Magento\Framework\GraphQl\Query\Uid;
13+
@@ -84,6 +85,12 @@ class UpdateCompanyRole implements ResolverInterface
14+
*/
15+
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
16+
{
17+
+ if (false === $context->getExtensionAttributes()->getIsCustomer()) {
18+
+ throw new GraphQlAuthenticationException(
19+
+ __('The current customer isn\'t authorized.')
20+
+ );
21+
+ }
22+
+
23+
$this->resolverAccess->isAllowed($this->allowedResources);
24+
25+
if (empty($args['input']) || !is_array($args['input'])) {
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
diff --git a/vendor/magento/module-staging/Model/Entity/Update/Action/Save/SaveAction.php b/vendor/magento/module-staging/Model/Entity/Update/Action/Save/SaveAction.php
2+
index 0fa78c23008..60f589eee37 100644
3+
--- a/vendor/magento/module-staging/Model/Entity/Update/Action/Save/SaveAction.php
4+
+++ b/vendor/magento/module-staging/Model/Entity/Update/Action/Save/SaveAction.php
5+
@@ -29,6 +29,7 @@ class SaveAction implements ActionInterface
6+
/**
7+
* @var UpdateService
8+
* @deprecated 100.1.0 Since functionality if this service was implemented in SaveAction class
9+
+ * @see nothing
10+
*/
11+
private $updateService;
12+
13+
@@ -118,22 +119,19 @@ class SaveAction implements ActionInterface
14+
15+
if (!isset($stagingData['update_id']) || empty($stagingData['update_id'])) {
16+
$update = $this->createUpdate($stagingData);
17+
+ $entity = $this->entityHydrator->hydrate($entityData);
18+
$this->versionManager->setCurrentVersionId($update->getId());
19+
-
20+
- $this->schedule($entityData, $update->getId());
21+
+ $this->entityStaging->schedule($entity, $update->getId(), []);
22+
} else {
23+
$update = $this->updateRepository->get($stagingData['update_id']);
24+
$this->versionManager->setCurrentVersionId($update->getId());
25+
26+
$update = $this->editUpdate($stagingData);
27+
28+
- $this->schedule(
29+
- $entityData,
30+
- $update->getId(),
31+
- [
32+
- 'origin_in' => $stagingData['update_id'],
33+
- ]
34+
- );
35+
+ $entity = $this->entityHydrator->hydrate($entityData);
36+
+ $this->entityStaging->schedule($entity, $update->getId(), [
37+
+ 'origin_in' => $stagingData['update_id'],
38+
+ ]);
39+
}
40+
41+
return true;
42+
@@ -200,19 +198,4 @@ class SaveAction implements ActionInterface
43+
44+
return $update;
45+
}
46+
-
47+
- /**
48+
- * Set schedule for requested entity
49+
- *
50+
- * @param array $entityData
51+
- * @param int $version
52+
- * @param array $arguments
53+
- * @return void
54+
- */
55+
- private function schedule(array $entityData, $version, array $arguments = [])
56+
- {
57+
- $entity = $this->entityHydrator->hydrate($entityData);
58+
-
59+
- $this->entityStaging->schedule($entity, $version, $arguments);
60+
- }
61+
}

patches/os/ACSD-47657_2.4.4.patch

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
diff --git a/vendor/magento/module-aws-s3/Driver/AwsS3Factory.php b/vendor/magento/module-aws-s3/Driver/AwsS3Factory.php
2+
index 66c95e97ace0..b1cec93ed8f7 100644
3+
--- a/vendor/magento/module-aws-s3/Driver/AwsS3Factory.php
4+
+++ b/vendor/magento/module-aws-s3/Driver/AwsS3Factory.php
5+
@@ -54,6 +54,11 @@ class AwsS3Factory implements DriverFactoryInterface
6+
*/
7+
private $cachePrefix;
8+
9+
+ /**
10+
+ * @var CachedCredentialsProvider
11+
+ */
12+
+ private $cachedCredentialsProvider;
13+
+
14+
/**
15+
* @param ObjectManagerInterface $objectManager
16+
* @param Config $config
17+
@@ -61,6 +66,7 @@ class AwsS3Factory implements DriverFactoryInterface
18+
* @param CacheInterfaceFactory $cacheInterfaceFactory
19+
* @param CachedAdapterInterfaceFactory $cachedAdapterInterfaceFactory
20+
* @param string|null $cachePrefix
21+
+ * @param CachedCredentialsProvider|null $cachedCredentialsProvider
22+
*/
23+
public function __construct(
24+
ObjectManagerInterface $objectManager,
25+
@@ -68,7 +74,8 @@ public function __construct(
26+
MetadataProviderInterfaceFactory $metadataProviderFactory,
27+
CacheInterfaceFactory $cacheInterfaceFactory,
28+
CachedAdapterInterfaceFactory $cachedAdapterInterfaceFactory,
29+
- string $cachePrefix = null
30+
+ string $cachePrefix = null,
31+
+ ?CachedCredentialsProvider $cachedCredentialsProvider = null,
32+
) {
33+
$this->objectManager = $objectManager;
34+
$this->config = $config;
35+
@@ -76,6 +83,8 @@ public function __construct(
36+
$this->cacheInterfaceFactory = $cacheInterfaceFactory;
37+
$this->cachedAdapterInterfaceFactory = $cachedAdapterInterfaceFactory;
38+
$this->cachePrefix = $cachePrefix;
39+
+ $this->cachedCredentialsProvider = $cachedCredentialsProvider ??
40+
+ $this->objectManager->get(CachedCredentialsProvider::class);
41+
}
42+
43+
/**
44+
@@ -94,18 +103,19 @@ public function create(): RemoteDriverInterface
45+
}
46+
47+
/**
48+
- * @inheritDoc
49+
+ * Prepare config for S3Client
50+
+ *
51+
+ * @param array $config
52+
+ * @return array
53+
+ * @throws DriverException
54+
*/
55+
- public function createConfigured(
56+
- array $config,
57+
- string $prefix,
58+
- string $cacheAdapter = '',
59+
- array $cacheConfig = []
60+
- ): RemoteDriverInterface {
61+
+ private function prepareConfig(array $config)
62+
+ {
63+
$config['version'] = 'latest';
64+
65+
if (empty($config['credentials']['key']) || empty($config['credentials']['secret'])) {
66+
- unset($config['credentials']);
67+
+ //Access keys were not provided; request token from AWS config (local or EC2) and cache result
68+
+ $config['credentials'] = $this->cachedCredentialsProvider->get();
69+
}
70+
71+
if (empty($config['bucket']) || empty($config['region'])) {
72+
@@ -120,6 +130,19 @@ public function createConfigured(
73+
$config['use_path_style_endpoint'] = boolval($config['path_style']);
74+
}
75+
76+
+ return $config;
77+
+ }
78+
+
79+
+ /**
80+
+ * @inheritDoc
81+
+ */
82+
+ public function createConfigured(
83+
+ array $config,
84+
+ string $prefix,
85+
+ string $cacheAdapter = '',
86+
+ array $cacheConfig = []
87+
+ ): RemoteDriverInterface {
88+
+ $config = $this->prepareConfig($config);
89+
$client = new S3Client($config);
90+
$adapter = new AwsS3V3Adapter($client, $config['bucket'], $prefix);
91+
$cache = $this->cacheInterfaceFactory->create(
92+
diff --git a/vendor/magento/module-aws-s3/Driver/CachedCredentialsProvider.php b/vendor/magento/module-aws-s3/Driver/CachedCredentialsProvider.php
93+
new file mode 100644
94+
index 000000000000..0137284358bd
95+
--- /dev/null
96+
+++ b/vendor/magento/module-aws-s3/Driver/CachedCredentialsProvider.php
97+
@@ -0,0 +1,42 @@
98+
+<?php
99+
+/**
100+
+ * Copyright © Magento, Inc. All rights reserved.
101+
+ * See COPYING.txt for license details.
102+
+ */
103+
+declare(strict_types=1);
104+
+
105+
+namespace Magento\AwsS3\Driver;
106+
+
107+
+use Aws\Credentials\CredentialProvider;
108+
+
109+
+class CachedCredentialsProvider
110+
+{
111+
+ /**
112+
+ * @var CredentialsCache
113+
+ */
114+
+ private $magentoCacheAdapter;
115+
+
116+
+ /**
117+
+ * @param CredentialsCache $magentoCacheAdapter
118+
+ */
119+
+ public function __construct(CredentialsCache $magentoCacheAdapter)
120+
+ {
121+
+ $this->magentoCacheAdapter = $magentoCacheAdapter;
122+
+ }
123+
+
124+
+ /**
125+
+ * Provides cache mechanism to retrieve and store AWS credentials
126+
+ *
127+
+ * @return callable
128+
+ */
129+
+ public function get()
130+
+ {
131+
+ //phpcs:ignore Magento2.Functions.DiscouragedFunction
132+
+ return call_user_func(
133+
+ [CredentialProvider::class, 'cache'],
134+
+ //phpcs:ignore Magento2.Functions.DiscouragedFunction
135+
+ call_user_func([CredentialProvider::class, 'defaultProvider']),
136+
+ $this->magentoCacheAdapter
137+
+ );
138+
+ }
139+
+}
140+
diff --git a/vendor/magento/module-aws-s3/Driver/CredentialsCache.php b/vendor/magento/module-aws-s3/Driver/CredentialsCache.php
141+
new file mode 100644
142+
index 000000000000..337e9d2a2acf
143+
--- /dev/null
144+
+++ b/vendor/magento/module-aws-s3/Driver/CredentialsCache.php
145+
@@ -0,0 +1,82 @@
146+
+<?php
147+
+/**
148+
+ * Copyright © Magento, Inc. All rights reserved.
149+
+ * See COPYING.txt for license details.
150+
+ */
151+
+declare(strict_types=1);
152+
+
153+
+namespace Magento\AwsS3\Driver;
154+
+
155+
+use Aws\CacheInterface;
156+
+use Aws\Credentials\CredentialsFactory;
157+
+use Magento\Framework\App\CacheInterface as MagentoCacheInterface;
158+
+use Magento\Framework\Serialize\Serializer\Json;
159+
+
160+
+/** Cache Adapter for AWS credentials */
161+
+class CredentialsCache implements CacheInterface
162+
+{
163+
+ /**
164+
+ * @var MagentoCacheInterface
165+
+ */
166+
+ private $magentoCache;
167+
+
168+
+ /**
169+
+ * @var Json
170+
+ */
171+
+ private $json;
172+
+
173+
+ /**
174+
+ * @var CredentialsFactory
175+
+ */
176+
+ private $credentialsFactory;
177+
+
178+
+ /**
179+
+ * @param MagentoCacheInterface $magentoCache
180+
+ * @param CredentialsFactory $credentialsFactory
181+
+ * @param Json $json
182+
+ */
183+
+ public function __construct(MagentoCacheInterface $magentoCache, CredentialsFactory $credentialsFactory, Json $json)
184+
+ {
185+
+ $this->magentoCache = $magentoCache;
186+
+ $this->credentialsFactory = $credentialsFactory;
187+
+ $this->json = $json;
188+
+ }
189+
+
190+
+ /**
191+
+ * @inheritdoc
192+
+ */
193+
+ public function get($key)
194+
+ {
195+
+ $value = $this->magentoCache->load($key);
196+
+
197+
+ if (!is_string($value)) {
198+
+ return null;
199+
+ }
200+
+
201+
+ $result = $this->json->unserialize($value);
202+
+ try {
203+
+ return $this->credentialsFactory->create($result);
204+
+ } catch (\Exception $e) {
205+
+ return $result;
206+
+ }
207+
+ }
208+
+
209+
+ /**
210+
+ * @inheritdoc
211+
+ */
212+
+ public function set($key, $value, $ttl = 0)
213+
+ {
214+
+ if (method_exists($value, 'toArray')) {
215+
+ $value = $value->toArray();
216+
+ }
217+
+ $this->magentoCache->save($this->json->serialize($value), $key, [], $ttl);
218+
+ }
219+
+
220+
+ /**
221+
+ * @inheritdoc
222+
+ */
223+
+ public function remove($key)
224+
+ {
225+
+ $this->magentoCache->remove($key);
226+
+ }
227+
+}

0 commit comments

Comments
 (0)