Skip to content

Commit

Permalink
Merge branch '2.2-develop' into fix/2.2-issue-16555-multi-shipping-ex…
Browse files Browse the repository at this point in the history
…ception
  • Loading branch information
dmytro-ch committed Aug 3, 2018
2 parents def9a82 + 5a04525 commit 4268a75
Show file tree
Hide file tree
Showing 991 changed files with 17,040 additions and 4,331 deletions.
2 changes: 1 addition & 1 deletion README.md
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/ReportXml/ReportProvider.php
Expand Up @@ -57,7 +57,7 @@ public function __construct(
private function getIteratorName(Query $query)
{
$config = $query->getConfig();
return isset($config['iterator']) ? $config['iterator'] : null;
return $config['iterator'] ?? null;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/App/Action/Plugin/Authentication.php
Expand Up @@ -160,7 +160,7 @@ protected function _processNotLoggedInUser(\Magento\Framework\App\RequestInterfa
} else {
$this->_actionFlag->set('', \Magento\Framework\App\ActionInterface::FLAG_NO_DISPATCH, true);
$this->_response->setRedirect($this->_url->getCurrentUrl());
$this->messageManager->addError(__('Invalid Form Key. Please refresh the page.'));
$this->messageManager->addErrorMessage(__('Invalid Form Key. Please refresh the page.'));
$isRedirectNeeded = true;
}
}
Expand Down Expand Up @@ -205,7 +205,7 @@ protected function _performLogin(\Magento\Framework\App\RequestInterface $reques
$this->_auth->login($username, $password);
} catch (AuthenticationException $e) {
if (!$request->getParam('messageSent')) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
$request->setParam('messageSent', true);
$outputValue = false;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/App/Config.php
Expand Up @@ -68,6 +68,6 @@ public function isSetFlag($path)
if ($path) {
$configPath .= '/' . $path;
}
return (bool) $this->appConfig->get(System::CONFIG_TYPE, $configPath);
return (bool)$this->appConfig->get(System::CONFIG_TYPE, $configPath);
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/App/DefaultPath.php
Expand Up @@ -42,6 +42,6 @@ public function __construct(\Magento\Backend\App\ConfigInterface $config)
*/
public function getPart($code)
{
return isset($this->_parts[$code]) ? $this->_parts[$code] : null;
return $this->_parts[$code] ?? null;
}
}
8 changes: 0 additions & 8 deletions app/code/Magento/Backend/Block/Dashboard/Bar.php
Expand Up @@ -38,14 +38,6 @@ public function getTotals()
*/
public function addTotal($label, $value, $isQuantity = false)
{
/*if (!$isQuantity) {
$value = $this->format($value);
$decimals = substr($value, -2);
$value = substr($value, 0, -2);
} else {
$value = ($value != '')?$value:0;
$decimals = '';
}*/
if (!$isQuantity) {
$value = $this->format($value);
}
Expand Down
15 changes: 13 additions & 2 deletions app/code/Magento/Backend/Block/Media/Uploader.php
Expand Up @@ -5,6 +5,9 @@
*/
namespace Magento\Backend\Block\Media;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Serialize\Serializer\Json;

/**
* Adminhtml media library uploader
* @api
Expand All @@ -27,17 +30,25 @@ class Uploader extends \Magento\Backend\Block\Widget
*/
protected $_fileSizeService;

/**
* @var Json
*/
private $jsonEncoder;

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\File\Size $fileSize
* @param array $data
* @param Json $jsonEncoder
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\File\Size $fileSize,
array $data = []
array $data = [],
Json $jsonEncoder = null
) {
$this->_fileSizeService = $fileSize;
$this->jsonEncoder = $jsonEncoder ?: ObjectManager::getInstance()->get(Json::class);
parent::__construct($context, $data);
}

Expand Down Expand Up @@ -107,7 +118,7 @@ public function getJsObjectName()
*/
public function getConfigJson()
{
return $this->_coreData->jsonEncode($this->getConfig()->getData());
return $this->jsonEncoder->encode($this->getConfig()->getData());
}

/**
Expand Down
Expand Up @@ -26,7 +26,6 @@ public function getValue($index = null)
{
if ($index) {
if ($data = $this->getData('value', 'orig_' . $index)) {
// date('Y-m-d', strtotime($data));
return $data;
}
return null;
Expand Down Expand Up @@ -154,7 +153,7 @@ public function getEscapedValue($index = null)
if (is_string($value)) {
return $this->escapeHtml($value);
}

return $value;
}

Expand Down
Expand Up @@ -58,7 +58,7 @@ public function render(DataObject $row)
$result .= $this->getColumn()->getEditOnly() ? ''
: '<span class="admin__grid-control-value">' . $this->_getValue($row) . '</span>';

return $result . $this->_getInputValueElement($row) . '</div>' ;
return $result . $this->_getInputValueElement($row) . '</div>';
}
return $this->_getValue($row);
}
Expand Down
Expand Up @@ -276,13 +276,13 @@ public function getGridIdsJson()
}
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
$allIdsCollection = clone $this->getParentBlock()->getCollection();

if ($this->getMassactionIdField()) {
$massActionIdField = $this->getMassactionIdField();
} else {
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
}

$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
if (!empty($gridIds)) {
return join(",", $gridIds);
Expand Down
Expand Up @@ -273,13 +273,13 @@ public function getGridIdsJson()

/** @var \Magento\Framework\Data\Collection $allIdsCollection */
$allIdsCollection = clone $this->getParentBlock()->getCollection();

if ($this->getMassactionIdField()) {
$massActionIdField = $this->getMassactionIdField();
} else {
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
}

$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);

if (!empty($gridIds)) {
Expand Down

0 comments on commit 4268a75

Please sign in to comment.