Skip to content

Commit 0b7db43

Browse files
authored
Merge branch '2.4-develop' into novcomprs
2 parents f1428f3 + c135fc3 commit 0b7db43

File tree

65 files changed

+7926
-176
lines changed

Some content is hidden

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

65 files changed

+7926
-176
lines changed

app/code/Magento/Analytics/Model/Config/Backend/Baseurl/SubscriptionUpdateHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SubscriptionUpdateHandler
2424
/**
2525
* Config path for schedule setting of update handler.
2626
*/
27-
public const UPDATE_CRON_STRING_PATH = "crontab/default/jobs/analytics_update/schedule/cron_expr";
27+
public const UPDATE_CRON_STRING_PATH = "crontab/analytics/jobs/analytics_update/schedule/cron_expr";
2828

2929
/**
3030
* Flag code for the previous Base URL.

app/code/Magento/Analytics/Model/Config/Backend/CollectionTime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CollectionTime extends Value
2323
/**
2424
* The path to config setting of schedule of collection data cron.
2525
*/
26-
public const CRON_SCHEDULE_PATH = 'crontab/default/jobs/analytics_collect_data/schedule/cron_expr';
26+
public const CRON_SCHEDULE_PATH = 'crontab/analytics/jobs/analytics_collect_data/schedule/cron_expr';
2727

2828
/**
2929
* @var WriterInterface

app/code/Magento/Analytics/Model/Config/Backend/Enabled/SubscriptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SubscriptionHandler
2424
/**
2525
* Config path for schedule setting of subscription handler.
2626
*/
27-
public const CRON_STRING_PATH = 'crontab/default/jobs/analytics_subscribe/schedule/cron_expr';
27+
public const CRON_STRING_PATH = 'crontab/analytics/jobs/analytics_subscribe/schedule/cron_expr';
2828

2929
/**
3030
* Config value for schedule setting of subscription handler.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Analytics\Setup\Patch\Data;
10+
11+
use Magento\Framework\App\ResourceConnection;
12+
use Magento\Framework\Setup\Patch\DataPatchInterface;
13+
14+
/**
15+
* Migrate legacy cron config paths for analytics jobs from the "default" group to the "analytics" group.
16+
*/
17+
class MoveCronConfigToAnalyticsGroup implements DataPatchInterface
18+
{
19+
/**
20+
* @var ResourceConnection
21+
*/
22+
private $resourceConnection;
23+
24+
/**
25+
* @param ResourceConnection $resourceConnection
26+
*/
27+
public function __construct(
28+
ResourceConnection $resourceConnection
29+
) {
30+
$this->resourceConnection = $resourceConnection;
31+
}
32+
33+
/**
34+
* @inheritDoc
35+
*/
36+
public function apply()
37+
{
38+
$connection = $this->resourceConnection->getConnection();
39+
$table = $this->resourceConnection->getTableName('core_config_data');
40+
41+
// Find all analytics cron rows under the "default" cron group
42+
$select = $connection->select()
43+
->from($table, ['config_id', 'scope', 'scope_id', 'path', 'value'])
44+
->where('path LIKE ?', 'crontab/default/jobs/analytics_%');
45+
$rows = (array)$connection->fetchAll($select);
46+
47+
foreach ($rows as $row) {
48+
$oldPath = (string)$row['path'];
49+
$newPath = (string)preg_replace('#^crontab/default/#', 'crontab/analytics/', $oldPath);
50+
51+
$connection->update(
52+
$table,
53+
['path' => $newPath],
54+
['config_id = ?' => (int)$row['config_id']]
55+
);
56+
}
57+
58+
return $this;
59+
}
60+
61+
/**
62+
* @inheritDoc
63+
*/
64+
public static function getDependencies()
65+
{
66+
return [];
67+
}
68+
69+
/**
70+
* @inheritDoc
71+
*/
72+
public function getAliases()
73+
{
74+
return [];
75+
}
76+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/cron_groups.xsd">
9+
<group id="analytics">
10+
<schedule_generate_every>15</schedule_generate_every>
11+
<schedule_ahead_for>20</schedule_ahead_for>
12+
<schedule_lifetime>15</schedule_lifetime>
13+
<history_cleanup_every>10</history_cleanup_every>
14+
<history_success_lifetime>60</history_success_lifetime>
15+
<history_failure_lifetime>4320</history_failure_lifetime>
16+
<use_separate_process>1</use_separate_process>
17+
</group>
18+
</config>

app/code/Magento/Analytics/etc/crontab.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
9-
<group id="default">
9+
<group id="analytics">
1010
<job name="analytics_subscribe" instance="Magento\Analytics\Cron\SignUp" method="execute" />
1111
<job name="analytics_update" instance="Magento\Analytics\Cron\Update" method="execute" />
1212
<job name="analytics_collect_data" instance="Magento\Analytics\Cron\CollectData" method="execute" />

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@
260260
<item name="analytics/general/token" xsi:type="string">1</item>
261261
</argument>
262262
<argument name="environment" xsi:type="array">
263-
<item name="crontab/default/jobs/analytics_collect_data/schedule/cron_expr" xsi:type="string">1</item>
264-
<item name="crontab/default/jobs/analytics_update/schedule/cron_expr" xsi:type="string">1</item>
265-
<item name="crontab/default/jobs/analytics_subscribe/schedule/cron_expr" xsi:type="string">1</item>
263+
<item name="crontab/analytics/jobs/analytics_collect_data/schedule/cron_expr" xsi:type="string">1</item>
264+
<item name="crontab/analytics/jobs/analytics_update/schedule/cron_expr" xsi:type="string">1</item>
265+
<item name="crontab/analytics/jobs/analytics_subscribe/schedule/cron_expr" xsi:type="string">1</item>
266266
</argument>
267267
</arguments>
268268
</type>

app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ public function __construct(
5555
public function execute()
5656
{
5757
$this->_setTypeId();
58-
$attributeSet = $this->attributeSetRepository->get($this->getRequest()->getParam('id'));
58+
59+
try {
60+
$attributeSetId = $this->getRequest()->getParam('id');
61+
$attributeSet = $this->attributeSetRepository->get($attributeSetId);
62+
} catch (NoSuchEntityException $e) {
63+
$this->messageManager->addErrorMessage(__('Attribute set %1 does not exist.', $attributeSetId));
64+
return $this->resultRedirectFactory->create()->setPath('catalog/*/index');
65+
}
66+
5967
if (!$attributeSet->getId()) {
6068
return $this->resultRedirectFactory->create()->setPath('catalog/*/index');
6169
}

app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public function containsValue($entityType, $entity, $attributeCode, $storeId)
105105
* @return array
106106
*
107107
* @deprecated 101.0.0
108+
* @see MAGETWO-71174
108109
*/
109110
public function getDefaultValues($entityType, $entity)
110111
{
@@ -157,6 +158,10 @@ private function initAttributeValues($entityType, $entity, $storeId)
157158
$selects[] = $select;
158159
}
159160

161+
if (empty($selects)) {
162+
return;
163+
}
164+
160165
$unionSelect = new \Magento\Framework\DB\Sql\UnionExpression(
161166
$selects,
162167
\Magento\Framework\DB\Select::SQL_UNION_ALL

app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,23 @@ public function updateCustomerFromVisitor($object)
259259
return $this;
260260
}
261261

262+
/**
263+
* Assign customer to compare list items
264+
*
265+
* @param int $listId
266+
* @param int $customerId
267+
* @return $this
268+
*/
269+
public function updateCustomerIdForListItems(int $listId, int $customerId)
270+
{
271+
$this->getConnection()->update(
272+
$this->getMainTable(),
273+
['customer_id' => $customerId],
274+
['list_id = ?' => $listId]
275+
);
276+
return $this;
277+
}
278+
262279
/**
263280
* Clear compare items by visitor and/or customer
264281
*

0 commit comments

Comments
 (0)