Skip to content

Commit abe22bc

Browse files
authored
Merge pull request #7924 from magento-gl/Hammer_PlatForm_Health_246_Scope_04102022
[Hammer]_platform_health_246_scope_04102022
2 parents a99d718 + cf32ddd commit abe22bc

File tree

6 files changed

+319
-94
lines changed

6 files changed

+319
-94
lines changed

app/code/Magento/Analytics/Test/Mftf/ActionGroup/AssertAdminAdvancedReportingPageUrlActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
<switchToNextTab stepKey="switchToNewTab"/>
1717
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/>
18-
<seeInCurrentUrl url="reports/advanced-reporting" stepKey="seeAssertAdvancedReportingPageUrl"/>
18+
<seeInCurrentUrl url="report" stepKey="seeAssertAdvancedReportingPageUrl"/>
1919
</actionGroup>
2020
</actionGroups>

app/code/Magento/Config/Model/Config/Backend/Currency/Cron.php

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
namespace Magento\Config\Model\Config\Backend\Currency;
1111

12+
use Magento\Framework\Exception\LocalizedException;
13+
1214
/**
1315
* Cron job configuration for currency
1416
*
@@ -17,8 +19,7 @@
1719
*/
1820
class Cron extends \Magento\Framework\App\Config\Value
1921
{
20-
const CRON_STRING_PATH = 'crontab/default/jobs/currency_rates_update/schedule/cron_expr';
21-
22+
public const CRON_STRING_PATH = 'crontab/default/jobs/currency_rates_update/schedule/cron_expr';
2223
/**
2324
* @var \Magento\Framework\App\Config\ValueFactory
2425
*/
@@ -52,13 +53,28 @@ public function __construct(
5253
* After save handler
5354
*
5455
* @return $this
55-
* @throws \Exception
56+
* @throws LocalizedException
5657
*/
5758
public function afterSave()
5859
{
5960
$time = $this->getData('groups/import/fields/time/value');
60-
$frequency = $this->getData('groups/import/fields/frequency/value');
61-
61+
if (empty($time)) {
62+
$time = explode(
63+
',',
64+
$this->_config->getValue(
65+
'currency/import/time',
66+
$this->getScope(),
67+
$this->getScopeId()
68+
) ?: '0,0,0'
69+
);
70+
$frequency = $this->_config->getValue(
71+
'currency/import/frequency',
72+
$this->getScope(),
73+
$this->getScopeId()
74+
);
75+
} else {
76+
$frequency = $this->getData('groups/import/fields/frequency/value');
77+
}
6278
$frequencyWeekly = \Magento\Cron\Model\Config\Source\Frequency::CRON_WEEKLY;
6379
$frequencyMonthly = \Magento\Cron\Model\Config\Source\Frequency::CRON_MONTHLY;
6480

@@ -78,7 +94,7 @@ public function afterSave()
7894
$configValue->load(self::CRON_STRING_PATH, 'path');
7995
$configValue->setValue($cronExprString)->setPath(self::CRON_STRING_PATH)->save();
8096
} catch (\Exception $e) {
81-
throw new \Exception(__('We can\'t save the Cron expression.'));
97+
throw new LocalizedException(__('We can\'t save the Cron expression.'));
8298
}
8399
return parent::afterSave();
84100
}

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"colinmollenhour/cache-backend-redis": "1.14.2",
3939
"colinmollenhour/credis": "1.13.0",
4040
"colinmollenhour/php-redis-session-abstract": "v1.5.0",
41-
"composer/composer": "^1.9 || ^2.0, !=2.2.16",
41+
"composer/composer": "^2.0, !=2.2.16",
4242
"elasticsearch/elasticsearch": "~7.17.0",
4343
"ezyang/htmlpurifier": "^4.14",
4444
"guzzlehttp/guzzle": "^7.4.2",
@@ -78,7 +78,8 @@
7878
"phpseclib/mcrypt_compat": "~2.0.2",
7979
"phpseclib/phpseclib": "~3.0.13",
8080
"ramsey/uuid": "~4.2.0",
81-
"symfony/console": "~5.4.10",
81+
"symfony/console": "~5.4.12",
82+
"symfony/string": "~5.4.12",
8283
"symfony/intl": "~5.4.11",
8384
"symfony/process": "~5.4.8",
8485
"tedivm/jshrink": "~1.4.0",

0 commit comments

Comments
 (0)