Skip to content

Commit

Permalink
Merge branch '2.3-develop' of github.com:magento/magento2ce into batc…
Browse files Browse the repository at this point in the history
…h-35-forwardport-2.3-develop
  • Loading branch information
ishakhsuvarov committed Feb 28, 2018
2 parents bd07bcc + 87e96d3 commit 1693019
Show file tree
Hide file tree
Showing 1,176 changed files with 22,207 additions and 10,164 deletions.
4 changes: 2 additions & 2 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

/**
* Pre-commit hook installation:
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
* PHP Coding Standards fixer configuration
*/

$finder = PhpCsFixer\Finder::create()
->name('*.phtml')
->exclude('dev/tests/functional/generated')
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_AdminNotification" setup_version="2.0.0">
<module name="Magento_AdminNotification" >
<sequence>
<module name="Magento_Store"/>
</sequence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_AdvancedPricingImportExport" setup_version="2.0.0">
<module name="Magento_AdvancedPricingImportExport" >
</module>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public function afterSave()
$result = preg_match('#(?<hour>\d{2}),(?<min>\d{2}),(?<sec>\d{2})#', $this->getValue(), $time);

if (!$result) {
throw new LocalizedException(__('Time value has an unsupported format'));
throw new LocalizedException(
__('The time value is using an unsupported format. Enter a supported format and try again.')
);
}

$cronExprArray = [
Expand Down
13 changes: 9 additions & 4 deletions app/code/Magento/Analytics/Model/Cryptographer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ public function encode($source)
try {
$source = (string)$source;
} catch (\Exception $e) {
throw new LocalizedException(__('Input data must be string or convertible into string.'));
throw new LocalizedException(
__(
'The data is invalid. '
. 'Enter the data as a string or data that can be converted into a string and try again.'
)
);
}
} elseif (!$source) {
throw new LocalizedException(__('Input data must be non-empty string.'));
throw new LocalizedException(__('The data is invalid. Enter the data as a string and try again.'));
}
if (!$this->validateCipherMethod($this->cipherMethod)) {
throw new LocalizedException(__('Not valid cipher method.'));
throw new LocalizedException(__('The data is invalid. Use a valid cipher method and try again.'));
}
$initializationVector = $this->getInitializationVector();

Expand Down Expand Up @@ -90,7 +95,7 @@ private function getKey()
{
$token = $this->analyticsToken->getToken();
if (!$token) {
throw new LocalizedException(__('Encryption key can\'t be empty.'));
throw new LocalizedException(__('Enter the encryption key and try again.'));
}
return hash('sha256', $token);
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/Model/ExportDataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private function pack($source, $destination)
private function validateSource(WriteInterface $directory, $path)
{
if (!$directory->isExist($path)) {
throw new LocalizedException(__('Source "%1" is not exist', $directory->getAbsolutePath($path)));
throw new LocalizedException(__('The "%1" source doesn\'t exist.', $directory->getAbsolutePath($path)));
}

return $directory->getAbsolutePath($path);
Expand Down
52 changes: 0 additions & 52 deletions app/code/Magento/Analytics/Setup/InstallData.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Analytics\Setup\Patch\Data;

use Magento\Analytics\Model\Config\Backend\Enabled\SubscriptionHandler;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Setup\Model\Patch\DataPatchInterface;
use Magento\Setup\Model\Patch\PatchVersionInterface;

/**
* Initial patch.
*
* @package Magento\Analytics\Setup\Patch
*/
class PrepareInitialConfig implements DataPatchInterface, PatchVersionInterface
{
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;

/**
* PrepareInitialConfig constructor.
* @param ModuleDataSetupInterface $moduleDataSetup
*/
public function __construct(
ModuleDataSetupInterface $moduleDataSetup
) {
$this->moduleDataSetup = $moduleDataSetup;
}

/**
* {@inheritdoc}
*/
public function apply()
{
$this->moduleDataSetup->getConnection()->insertMultiple(
$this->moduleDataSetup->getTable('core_config_data'),
[
[
'scope' => 'default',
'scope_id' => 0,
'path' => 'analytics/subscription/enabled',
'value' => 1
],
[
'scope' => 'default',
'scope_id' => 0,
'path' => SubscriptionHandler::CRON_STRING_PATH,
'value' => join(' ', SubscriptionHandler::CRON_EXPR_ARRAY)
]
]
);

$this->moduleDataSetup->getConnection()->insert(
$this->moduleDataSetup->getTable('flag'),
[
'flag_code' => SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE,
'state' => 0,
'flag_data' => 24,
]
);
}

/**
* {@inheritdoc}
*/
public static function getDependencies()
{
return [];
}

/**
* {@inheritdoc}
*/
public static function getVersion()
{
return '2.0.0';
}

/**
* {@inheritdoc}
*/
public function getAliases()
{
return [];
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Analytics" setup_version="2.0.0">
<module name="Magento_Analytics" >
<sequence>
<module name="Magento_Integration"/>
<module name="Magento_Backend"/>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/Model/Acl/AclRetriever.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function getAllowedResourcesByUser($userType, $userId)
$role = $this->_getUserRole($userType, $userId);
if (!$role) {
throw new AuthorizationException(
__('We can\'t find the role for the user you wanted.')
__("The role wasn't found for the user. Verify the role and try again.")
);
}
$allowedResources = $this->getAllowedResourcesByRole($role->getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,48 @@
* See COPYING.txt for license details.
*/

namespace Magento\Authorization\Setup;
namespace Magento\Authorization\Setup\Patch\Data;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Setup\Model\Patch\DataPatchInterface;
use Magento\Setup\Model\Patch\PatchVersionInterface;
use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
use Magento\Authorization\Model\UserContextInterface;

/**
* @codeCoverageIgnore
* Class InitializeAuthRoles
* @package Magento\Authorization\Setup\Patch
*/
class InstallData implements InstallDataInterface
class InitializeAuthRoles implements DataPatchInterface, PatchVersionInterface
{
/**
* Authorization factory
*
* @var AuthorizationFactory
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;

/**
* @var \Magento\Authorization\Setup\AuthorizationFactory
*/
private $authFactory;

/**
* Init
*
* @param AuthorizationFactory $authFactory
* InitializeAuthRoles constructor.
* @param ModuleDataSetupInterface $moduleDataSetup
* @param \Magento\Authorization\Setup\AuthorizationFactory $authorizationFactory
*/
public function __construct(AuthorizationFactory $authFactory)
{
$this->authFactory = $authFactory;
public function __construct(
ModuleDataSetupInterface $moduleDataSetup,
\Magento\Authorization\Setup\AuthorizationFactory $authorizationFactory
) {
$this->moduleDataSetup = $moduleDataSetup;
$this->authFactory = $authorizationFactory;
}

/**
* {@inheritdoc}
*/
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
public function apply()
{
$roleCollection = $this->authFactory->createRoleCollection()
->addFieldToFilter('parent_id', 0)
Expand All @@ -60,6 +68,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
]
)->save();
} else {
/** @var \Magento\Authorization\Model\ResourceModel\Role $item */
foreach ($roleCollection as $item) {
$admGroupRole = $item;
break;
Expand Down Expand Up @@ -89,13 +98,36 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
/**
* Delete rows by condition from authorization_rule
*/
$setup->startSetup();

$tableName = $setup->getTable('authorization_rule');
$tableName = $this->moduleDataSetup->getTable('authorization_rule');
if ($tableName) {
$setup->getConnection()->delete($tableName, ['resource_id = ?' => 'admin/system/tools/compiler']);
$this->moduleDataSetup->getConnection()->delete(
$tableName,
['resource_id = ?' => 'admin/system/tools/compiler']
);
}
}

/**
* {@inheritdoc}
*/
public static function getDependencies()
{
return [];
}

$setup->endSetup();
/**
* {@inheritdoc}
*/
public static function getVersion()
{
return '2.0.0';
}

/**
* {@inheritdoc}
*/
public function getAliases()
{
return [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testGetAllowedResourcesByUserTypeCustomer()

/**
* @expectedException \Magento\Framework\Exception\AuthorizationException
* @expectedExceptionMessage We can't find the role for the user you wanted.
* @expectedExceptionMessage The role wasn't found for the user. Verify the role and try again.
*/
public function testGetAllowedResourcesByUserRoleNotFound()
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Authorization" setup_version="2.0.0">
<module name="Magento_Authorization" >
<sequence>
<module name="Magento_Backend"/>
</sequence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Authorizenet\Controller\Directpost\Payment;

use Magento\Authorizenet\Controller\Directpost\Payment;
Expand Down Expand Up @@ -147,7 +148,7 @@ protected function placeCheckoutOrder()
$result->setData('error', true);
$result->setData(
'error_messages',
__('An error occurred on the server. Please try to place the order again.')
__('A server error stopped your order from being placed. Please try to place your order again.')
);
}
if ($response instanceof Http) {
Expand Down
Loading

0 comments on commit 1693019

Please sign in to comment.