Skip to content

Commit

Permalink
Merge pull request #2 from magento/2.2-develop
Browse files Browse the repository at this point in the history
Updating repo
  • Loading branch information
markshust authored Aug 16, 2018
2 parents 1ce8c0a + ecebc42 commit 99a616d
Show file tree
Hide file tree
Showing 3,948 changed files with 57,671 additions and 20,097 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
146 changes: 145 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To learn more about issue gate labels click [here](https://github.com/magento/ma

<h2>Reporting security issues</h2>

To report security vulnerabilities in Magento software or web sites, please e-mail <a href="mailto:security@magento.com">security@magento.com</a>. Please do not report security issues using GitHub. Be sure to encrypt your e-mail with our <a href="https://info2.magento.com/rs/magentoenterprise/images/security_at_magento.asc">encryption key</a> if it includes sensitive information. Learn more about reporting security issues <a href="https://magento.com/security/reporting-magento-security-issue">here</a>.
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account <a href="https://bugcrowd.com/magento">there</a> to submit and follow-up your issue. Learn more about reporting security issues <a href="https://magento.com/security/reporting-magento-security-issue">here</a>.

Stay up-to-date on the latest security news and patches for Magento by signing up for <a href="https://magento.com/security/sign-up">Security Alert Notifications</a>.

Expand Down
10 changes: 7 additions & 3 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@
&& isset($_SERVER['HTTP_ACCEPT'])
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
) {
$profilerFlag = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
$profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
? $_SERVER['MAGE_PROFILER']
: trim(file_get_contents(BP . '/var/profiler.flag'));

\Magento\Framework\Profiler::applyConfig(
$profilerFlag,
if ($profilerConfig) {
$profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
}

Magento\Framework\Profiler::applyConfig(
$profilerConfig,
BP,
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public function execute()
)->markAsRead(
$notificationId
);
$this->messageManager->addSuccess(__('The message has been marked as Read.'));
$this->messageManager->addSuccessMessage(__('The message has been marked as Read.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException(
$this->messageManager->addExceptionMessage(
$e,
__("We couldn't mark the notification as Read because of an error.")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
$this->messageManager->addError(__('Please select messages.'));
$this->messageManager->addErrorMessage(__('Please select messages.'));
} else {
try {
foreach ($ids as $id) {
Expand All @@ -32,13 +32,13 @@ public function execute()
$model->setIsRead(1)->save();
}
}
$this->messageManager->addSuccess(
$this->messageManager->addSuccessMessage(
__('A total of %1 record(s) have been marked as Read.', count($ids))
);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException(
$this->messageManager->addExceptionMessage(
$e,
__("We couldn't mark the notification as Read because of an error.")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
$this->messageManager->addError(__('Please select messages.'));
$this->messageManager->addErrorMessage(__('Please select messages.'));
} else {
try {
foreach ($ids as $id) {
Expand All @@ -32,11 +32,12 @@ public function execute()
$model->setIsRemove(1)->save();
}
}
$this->messageManager->addSuccess(__('Total of %1 record(s) have been removed.', count($ids)));
$this->messageManager->addSuccessMessage(__('Total of %1 record(s) have been removed.', count($ids)));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
$this->messageManager
->addExceptionMessage($e, __("We couldn't remove the messages because of an error."));
}
}
$this->_redirect('adminhtml/*/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public function execute()

try {
$model->setIsRemove(1)->save();
$this->messageManager->addSuccess(__('The message has been removed.'));
$this->messageManager->addSuccessMessage(__('The message has been removed.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
$this->messageManager
->addExceptionMessage($e, __("We couldn't remove the messages because of an error."));
}

$this->_redirect('adminhtml/*/');
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/AdminNotification/Test/Mftf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Admin Notification Functional Tests

The Functional Test Module for **Magento Admin Notification** module.
20 changes: 20 additions & 0 deletions app/code/Magento/AdminNotification/Test/Mftf/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "magento/functional-test-module-admin-notification",
"description": "N/A",
"config": {
"sort-packages": true
},
"require": {
"php": "~7.0.13|~7.1.0",
"magento/functional-test-module-store": "100.0.0-dev",
"magento/functional-test-module-backend": "100.0.0-dev",
"magento/functional-test-module-media-storage": "100.0.0-dev",
"magento/magento2-functional-testing-framework": "2.2.0",
"magento/functional-test-module-ui": "100.0.0-dev"
},
"type": "magento2-test",
"license": [
"OSL-3.0",
"AFL-3.0"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public function testGetIdentity($expectedSum, $cacheTypes)
$this->assertEquals($expectedSum, $this->_messageModel->getIdentity());
}

/**
* @return array
*/
public function getIdentityDataProvider()
{
$cacheTypeMock1 = $this->createPartialMock(\stdClass::class, ['getCacheType']);
Expand Down Expand Up @@ -95,6 +98,9 @@ public function testIsDisplayed($expected, $allowed, $cacheTypes)
$this->assertEquals($expected, $this->_messageModel->isDisplayed());
}

/**
* @return array
*/
public function isDisplayedDataProvider()
{
$cacheTypesMock = $this->createPartialMock(\stdClass::class, ['getCacheType']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public function testIsDisplayed($expectedFirstRun, $data)
$this->assertEquals($expectedFirstRun, $model->isDisplayed());
}

/**
* @return array
*/
public function isDisplayedDataProvider()
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public function testIsDisplayed($expectedResult, $cached, $response)
$this->assertEquals($expectedResult, $this->_messageModel->isDisplayed());
}

/**
* @return array
*/
public function isDisplayedDataProvider()
{
return [
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 @@ -11,7 +11,7 @@
"lib-libxml": "*"
},
"type": "magento2-module",
"version": "100.2.2",
"version": "100.2.3",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{
"[data-role=system_messages_list]": {
"Magento_AdminNotification/js/system/messages/popup": {
class: 'modal-system-messages ui-popup-message'
"class":"modal-system-messages ui-popup-message"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
*/

define([
'jquery',
'Magento_Ui/js/modal/modal'
], function ($) {
], function ($, modal) {
'use strict';

return function (data, element) {
if (this.modal) {
this.modal.html($(element).html());

if (modal.modal) {
modal.modal.html($(element).html());
} else {
this.modal = $(element).modal({
modal.modal = $(element).modal({
modalClass: data.class,
type: 'popup',
buttons: []
});
}
this.modal.modal('openModal');

modal.modal.modal('openModal');
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public function execute()
);
return $resultLayout;
} catch (\Exception $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
}
} else {
$this->messageManager->addError(__('Please correct the data sent.'));
$this->messageManager->addErrorMessage(__('Please correct the data sent.'));
}
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
* @param ImportProduct\StoreResolver $storeResolver
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
* @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand Down Expand Up @@ -192,6 +191,7 @@ protected function initTypeModels()
* Export process
*
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function export()
{
Expand Down Expand Up @@ -461,6 +461,7 @@ protected function getTierPrices(array $productLinksIds, $table)
*
* @param int $websiteId
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
protected function _getWebsiteCode(int $websiteId): string
{
Expand Down Expand Up @@ -491,6 +492,8 @@ protected function _getWebsiteCode(int $websiteId): string
* @param int $customerGroupId
* @param int $allGroups
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function _getCustomerGroupById(
int $customerGroupId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
use Magento\Framework\App\ResourceConnection;

/**
* Class AdvancedPricing
Expand Down Expand Up @@ -619,6 +618,7 @@ protected function processCountNewPrices(array $tierPrices)
* Get product entity link field
*
* @return string
* @throws \Exception
*/
private function getProductEntityLinkField()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function __construct($validators = [])
*
* @param array $value
* @return bool
* @throws \Zend_Validate_Exception
*/
public function isValid($value)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Advanced Pricing Import Export Functional Tests

The Functional Test Module for **Magento Advanced Pricing Import Export** module.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "magento/functional-test-module-advanced-pricing-import-export",
"description": "N/A",
"config": {
"sort-packages": true
},
"require": {
"php": "~7.0.13|~7.1.0",
"magento/functional-test-module-catalog": "100.0.0-dev",
"magento/functional-test-module-catalog-inventory": "100.0.0-dev",
"magento/functional-test-module-eav": "100.0.0-dev",
"magento/functional-test-module-import-export": "100.0.0-dev",
"magento/functional-test-module-catalog-import-export": "100.0.0-dev",
"magento/functional-test-module-customer": "100.0.0-dev",
"magento/functional-test-module-store": "100.0.0-dev",
"magento/magento2-functional-testing-framework": "2.2.0"
},
"type": "magento2-test",
"license": [
"OSL-3.0",
"AFL-3.0"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ protected function setUp()
'_getCustomerGroupById',
'correctExportData'
]);
$this->advancedPricing = $this->getMockbuilder(
$this->advancedPricing = $this->getMockBuilder(
\Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing::class
)
->setMethods($mockMethods)
Expand Down Expand Up @@ -347,6 +347,7 @@ protected function tearDown()
* @param $object
* @param $property
* @return mixed
* @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
Expand All @@ -362,6 +363,8 @@ protected function getPropertyValue($object, $property)
* @param $object
* @param $property
* @param $value
* @return mixed
* @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ public function testIsValidAddMessagesCall($value, $hasEmptyColumns, $customerGr
$this->tierPrice->isValid($value);
}

/**
* @return array
*/
public function isValidResultFalseDataProvider()
{
return [
Expand Down Expand Up @@ -286,6 +289,9 @@ public function isValidResultFalseDataProvider()
];
}

/**
* @return array
*/
public function isValidAddMessagesCallDataProvider()
{
return [
Expand Down Expand Up @@ -340,6 +346,7 @@ public function isValidAddMessagesCallDataProvider()
* @param object $object
* @param string $property
* @return mixed
* @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
Expand All @@ -357,6 +364,7 @@ protected function getPropertyValue($object, $property)
* @param string $property
* @param mixed $value
* @return object
* @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ public function testGetAllWebsitesValue()
$this->assertEquals($expectedResult, $result);
}

/**
* @return array
*/
public function isValidReturnDataProvider()
{
return [
Expand Down
Loading

0 comments on commit 99a616d

Please sign in to comment.