Skip to content

Commit d4bd43f

Browse files
committed
Merge branch '2.3-develop' into cms-team-1-delivery-sprint-12
2 parents 09d8834 + fd076ae commit d4bd43f

File tree

78 files changed

+134
-195
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+134
-195
lines changed

app/code/Magento/Backend/Block/Dashboard/Bar.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ public function getTotals()
3838
*/
3939
public function addTotal($label, $value, $isQuantity = false)
4040
{
41-
/*if (!$isQuantity) {
42-
$value = $this->format($value);
43-
$decimals = substr($value, -2);
44-
$value = substr($value, 0, -2);
45-
} else {
46-
$value = ($value != '')?$value:0;
47-
$decimals = '';
48-
}*/
4941
if (!$isQuantity) {
5042
$value = $this->format($value);
5143
}

app/code/Magento/Captcha/Observer/CheckGuestCheckoutObserver.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ public function execute(\Magento\Framework\Event\Observer $observer)
6666
$formId = 'guest_checkout';
6767
$captchaModel = $this->_helper->getCaptcha($formId);
6868
$checkoutMethod = $this->_typeOnepage->getQuote()->getCheckoutMethod();
69-
if ($checkoutMethod == \Magento\Checkout\Model\Type\Onepage::METHOD_GUEST) {
70-
if ($captchaModel->isRequired()) {
71-
$controller = $observer->getControllerAction();
72-
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))
73-
) {
74-
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
75-
$result = ['error' => 1, 'message' => __('Incorrect CAPTCHA')];
76-
$controller->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
77-
}
69+
if ($checkoutMethod == \Magento\Checkout\Model\Type\Onepage::METHOD_GUEST
70+
&& $captchaModel->isRequired()
71+
) {
72+
$controller = $observer->getControllerAction();
73+
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))) {
74+
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
75+
$result = ['error' => 1, 'message' => __('Incorrect CAPTCHA')];
76+
$controller->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
7877
}
7978
}
8079

app/code/Magento/Captcha/Observer/CheckRegisterCheckoutObserver.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ public function execute(\Magento\Framework\Event\Observer $observer)
6666
$formId = 'register_during_checkout';
6767
$captchaModel = $this->_helper->getCaptcha($formId);
6868
$checkoutMethod = $this->_typeOnepage->getQuote()->getCheckoutMethod();
69-
if ($checkoutMethod == \Magento\Checkout\Model\Type\Onepage::METHOD_REGISTER) {
70-
if ($captchaModel->isRequired()) {
71-
$controller = $observer->getControllerAction();
72-
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))
73-
) {
74-
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
75-
$result = ['error' => 1, 'message' => __('Incorrect CAPTCHA')];
76-
$controller->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
77-
}
69+
if ($checkoutMethod == \Magento\Checkout\Model\Type\Onepage::METHOD_REGISTER
70+
&& $captchaModel->isRequired()
71+
) {
72+
$controller = $observer->getControllerAction();
73+
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))) {
74+
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
75+
$result = ['error' => 1, 'message' => __('Incorrect CAPTCHA')];
76+
$controller->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
7877
}
7978
}
8079

app/code/Magento/Captcha/Observer/CheckUserForgotPasswordBackendObserver.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,17 @@ public function execute(\Magento\Framework\Event\Observer $observer)
6969
$controller = $observer->getControllerAction();
7070
$email = (string)$observer->getControllerAction()->getRequest()->getParam('email');
7171
$params = $observer->getControllerAction()->getRequest()->getParams();
72-
if (!empty($email) && !empty($params)) {
73-
if ($captchaModel->isRequired()) {
74-
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))
75-
) {
76-
$this->_session->setEmail((string)$controller->getRequest()->getPost('email'));
77-
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
78-
$this->messageManager->addError(__('Incorrect CAPTCHA'));
79-
$controller->getResponse()->setRedirect(
80-
$controller->getUrl('*/*/forgotpassword', ['_nosecret' => true])
81-
);
82-
}
83-
}
72+
if (!empty($email)
73+
&& !empty($params)
74+
&& $captchaModel->isRequired()
75+
&& !$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId))
76+
) {
77+
$this->_session->setEmail((string)$controller->getRequest()->getPost('email'));
78+
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
79+
$this->messageManager->addError(__('Incorrect CAPTCHA'));
80+
$controller->getResponse()->setRedirect(
81+
$controller->getUrl('*/*/forgotpassword', ['_nosecret' => true])
82+
);
8483
}
8584

8685
return $this;

app/code/Magento/Captcha/Observer/CheckUserLoginBackendObserver.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ public function execute(\Magento\Framework\Event\Observer $observer)
5252
$formId = 'backend_login';
5353
$captchaModel = $this->_helper->getCaptcha($formId);
5454
$login = $observer->getEvent()->getUsername();
55-
if ($captchaModel->isRequired($login)) {
56-
if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($this->_request, $formId))) {
57-
$captchaModel->logAttempt($login);
58-
throw new PluginAuthenticationException(__('Incorrect CAPTCHA.'));
59-
}
55+
if ($captchaModel->isRequired($login)
56+
&& !$captchaModel->isCorrect($this->captchaStringResolver->resolve($this->_request, $formId))
57+
) {
58+
$captchaModel->logAttempt($login);
59+
throw new PluginAuthenticationException(__('Incorrect CAPTCHA.'));
6060
}
6161
$captchaModel->logAttempt($login);
6262

app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function getElementHtml()
102102
*/
103103
public function getImages()
104104
{
105-
return $this->registry->registry('current_product')->getData('media_gallery') ?: null;
105+
return $this->getDataObject()->getData('media_gallery') ?: null;
106106
}
107107

108108
/**

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ public function execute()
9292
$attributeSet->setEntityTypeId($this->_entityTypeId)->load($setName, 'attribute_set_name');
9393
if ($attributeSet->getId()) {
9494
$setName = $this->_objectManager->get(\Magento\Framework\Escaper::class)->escapeHtml($setName);
95-
$this->messageManager->addError(
96-
__('A "%1" attribute set name already exists. Create a new name and try again.', $setName)
97-
);
95+
$this->messageManager->addErrorMessage(__('An attribute set named \'%1\' already exists.', $setName));
9896

9997
$layout = $this->layoutFactory->create();
10098
$layout->initMessages();

app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ public function execute()
6464
$this->productRepository->delete($product);
6565
$productDeleted++;
6666
}
67-
$this->messageManager->addSuccess(
68-
__('A total of %1 record(s) have been deleted.', $productDeleted)
69-
);
67+
68+
if ($productDeleted) {
69+
$this->messageManager->addSuccessMessage(
70+
__('A total of %1 record(s) have been deleted.', $productDeleted)
71+
);
72+
}
7073

7174
return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT)->setPath('catalog/*/index');
7275
}

app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ public function getModel()
6767
*/
6868
protected function _prepareLayout()
6969
{
70-
// Load Wysiwyg on demand and Prepare layout
71-
// $block = $this->getLayout()->getBlock('head');
72-
// if ($this->_wysiwygConfig->isEnabled() && $block) {
73-
// $block->setCanLoadTinyMce(true);
74-
// }
75-
7670
$this->getToolbar()->addChild(
7771
'back_button',
7872
\Magento\Backend\Block\Widget\Button::class,

app/code/Magento/Review/Block/Adminhtml/Add/Form.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ protected function _prepareForm()
142142

143143
$fieldset->addField('product_id', 'hidden', ['name' => 'product_id']);
144144

145-
/*$gridFieldset = $form->addFieldset('add_review_grid', array('legend' => __('Please select a product')));
146-
$gridFieldset->addField('products_grid', 'note', array(
147-
'text' => $this->getLayout()->createBlock(\Magento\Review\Block\Adminhtml\Product\Grid::class)->toHtml(),
148-
));*/
149-
150145
$form->setMethod('post');
151146
$form->setUseContainer(true);
152147
$form->setId('edit_form');

0 commit comments

Comments
 (0)