Skip to content

Commit

Permalink
Merge branch '2.3.5-rc' into 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-team authored and fascinosum committed Apr 27, 2020
2 parents 5f3b86a + e5e866b commit dcc962e
Show file tree
Hide file tree
Showing 2,194 changed files with 82,124 additions and 14,891 deletions.
136 changes: 136 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2)
<h2>Welcome</h2>

## Welcome
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.

## Magento System Requirements
Expand Down Expand Up @@ -30,7 +31,7 @@ To suggest documentation improvements, click [here][4].
[4]: https://devdocs.magento.com

<h3>Community Maintainers</h3>
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions.
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks to these Community Maintainers for their valuable contributions.

<a href="https://magento.com/magento-contributors#maintainers">
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png"/>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"Magento\\AdminAnalytics\\": ""
}
},
"version": "100.3.1"
"version": "100.3.2"
}
17 changes: 17 additions & 0 deletions app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
<policies>
<policy id="script-src">
<values>
<value id="adobedtm" type="host">assets.adobedtm.com</value>
</values>
</policy>
</policies>
</csp_whitelist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
Expand Down Expand Up @@ -44,6 +43,8 @@ public function __construct(
}

/**
* System message list action
*
* @return \Magento\Framework\Controller\Result\Json
*/
public function execute()
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"Magento\\AdminNotification\\": ""
}
},
"version": "100.3.4"
"version": "100.3.5"
}
18 changes: 18 additions & 0 deletions app/code/Magento/AdminNotification/etc/csp_whitelist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
<policies>
<policy id="img-src">
<values>
<value id="commerce_widgets" type="host">widgets.magentocommerce.com</value>
</values>
</policy>
</policies>
</csp_whitelist>

11 changes: 7 additions & 4 deletions app/code/Magento/Analytics/Cron/SignUp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Magento\Analytics\Model\Config\Backend\Enabled\SubscriptionHandler;
use Magento\Analytics\Model\Connector;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\FlagManager;
use Magento\Framework\App\Config\ReinitableConfigInterface;
use Magento\Framework\App\Config\Storage\WriterInterface;
Expand Down Expand Up @@ -57,22 +58,24 @@ public function __construct(
}

/**
* Execute scheduled subscription operation
* Execute scheduled subscription operation.
*
* In case of failure writes message to notifications inbox
*
* @return bool
* @throws NotFoundException
*/
public function execute()
{
$attemptsCount = $this->flagManager->getFlagData(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE);
$attemptsCount = (int)$this->flagManager->getFlagData(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE);

if (($attemptsCount === null) || ($attemptsCount <= 0)) {
if ($attemptsCount <= 0) {
$this->deleteAnalyticsCronExpr();
$this->flagManager->deleteFlag(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE);
return false;
}

$attemptsCount -= 1;
$attemptsCount--;
$this->flagManager->saveFlag(SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE, $attemptsCount);
$signUpResult = $this->connector->execute('signUp');
if ($signUpResult === false) {
Expand Down
28 changes: 20 additions & 8 deletions app/code/Magento/Analytics/Cron/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Magento\Analytics\Model\AnalyticsToken;
use Magento\Analytics\Model\Config\Backend\Baseurl\SubscriptionUpdateHandler;
use Magento\Analytics\Model\Connector;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\FlagManager;
use Magento\Framework\App\Config\ReinitableConfigInterface;
use Magento\Framework\App\Config\Storage\WriterInterface;
Expand Down Expand Up @@ -67,26 +68,37 @@ public function __construct(
* Execute scheduled update operation
*
* @return bool
* @throws NotFoundException
*/
public function execute()
{
$result = false;
$attemptsCount = $this->flagManager
$attemptsCount = (int)$this->flagManager
->getFlagData(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE);

if ($attemptsCount) {
$attemptsCount -= 1;
if (($attemptsCount > 0) && $this->analyticsToken->isTokenExist()) {
$attemptsCount--;
$this->flagManager
->saveFlag(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE, $attemptsCount);
$result = $this->connector->execute('update');
}

if ($result || ($attemptsCount <= 0) || (!$this->analyticsToken->isTokenExist())) {
$this->flagManager
->deleteFlag(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE);
$this->flagManager->deleteFlag(SubscriptionUpdateHandler::PREVIOUS_BASE_URL_FLAG_CODE);
$this->configWriter->delete(SubscriptionUpdateHandler::UPDATE_CRON_STRING_PATH);
$this->reinitableConfig->reinit();
$this->exitFromUpdateProcess();
}

return $result;
}

/**
* Clean-up flags and refresh configuration
*/
private function exitFromUpdateProcess(): void
{
$this->flagManager
->deleteFlag(SubscriptionUpdateHandler::SUBSCRIPTION_UPDATE_REVERSE_COUNTER_FLAG_CODE);
$this->flagManager->deleteFlag(SubscriptionUpdateHandler::PREVIOUS_BASE_URL_FLAG_CODE);
$this->configWriter->delete(SubscriptionUpdateHandler::UPDATE_CRON_STRING_PATH);
$this->reinitableConfig->reinit();
}
}
7 changes: 7 additions & 0 deletions app/code/Magento/Analytics/ReportXml/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public function __construct(
}

/**
* Get select
*
* @return Select
*/
public function getSelect()
Expand All @@ -61,6 +63,8 @@ public function getSelect()
}

/**
* Get connection name
*
* @return string
*/
public function getConnectionName()
Expand All @@ -69,6 +73,8 @@ public function getConnectionName()
}

/**
* Get config
*
* @return array
*/
public function getConfig()
Expand All @@ -78,6 +84,7 @@ public function getConfig()

/**
* Specify data which should be serialized to JSON
*
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Analytics\Setup\Patch\Data;

use Magento\Analytics\Model\Config\Backend\CollectionTime;
use Magento\Analytics\Model\SubscriptionStatusProvider;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Setup\Patch\DataPatchInterface;

/**
* Activate data collection mechanism
*/
class ActivateDataCollection implements DataPatchInterface
{
/**
* @var ScopeConfigInterface
*/
private $scopeConfig;

/**
* @var SubscriptionStatusProvider
*/
private $subscriptionStatusProvider;

/**
* @var string
*/
private $analyticsCollectionTimeConfigPath = 'analytics/general/collection_time';

/**
* @var CollectionTime
*/
private $collectionTimeBackendModel;

/**
* @param ScopeConfigInterface $scopeConfig
* @param SubscriptionStatusProvider $subscriptionStatusProvider
* @param CollectionTime $collectionTimeBackendModel
*/
public function __construct(
ScopeConfigInterface $scopeConfig,
SubscriptionStatusProvider $subscriptionStatusProvider,
CollectionTime $collectionTimeBackendModel
) {
$this->scopeConfig = $scopeConfig;
$this->subscriptionStatusProvider = $subscriptionStatusProvider;
$this->collectionTimeBackendModel = $collectionTimeBackendModel;
}

/**
* @inheritDoc
*
* @throws LocalizedException
*/
public function apply()
{
$subscriptionStatus = $this->subscriptionStatusProvider->getStatus();
$isCollectionProcessActivated = $this->scopeConfig->getValue(CollectionTime::CRON_SCHEDULE_PATH);
if ($subscriptionStatus !== $this->subscriptionStatusProvider->getStatusForDisabledSubscription()
&& !$isCollectionProcessActivated
) {
$this->collectionTimeBackendModel
->setValue($this->scopeConfig->getValue($this->analyticsCollectionTimeConfigPath));
$this->collectionTimeBackendModel->setPath($this->analyticsCollectionTimeConfigPath);
$this->collectionTimeBackendModel->afterSave();
}

return $this;
}

/**
* @inheritDoc
*/
public function getAliases()
{
return [];
}

/**
* @inheritDoc
*/
public static function getDependencies()
{
return [
PrepareInitialConfig::class,
];
}
}
Loading

0 comments on commit dcc962e

Please sign in to comment.