Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit c268006

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento/magento2#17080: Removed double occurrences from files (by @mage2pratik) - magento/magento2#17045: [Forwardport] Fixing annotations for some methods. (by @torhoehn) - magento/magento2#17052: [Forwardport] Fix for Magnifier in inside mode (by @torhoehn) - magento/magento2#16925: [Up Port] Replacing Usage of Deprecated Methods for Message Manager. (by @tiagosampaio) - magento/magento2#17055: [Forwardport] Credit memo email template file: fixing incorrect object type error (by @torhoehn) - magento/magento2#17028: [Forwardport] Fixes Black color coding standard. (by @chirag-wagento) - magento/magento2#17106: [Forwardport] Slight Changes to Code (by @mage2pratik) - magento/magento2#17107: [Forwardport] Reduce lengthy code of LoginPost (by @mage2pratik) Fixed GitHub Issues: - magento/magento2#4977: Magnifier doesn't work with mode set to inner (reported by @theycallmepepper) has been fixed in magento/magento2#17052 by @torhoehn in 2.3-develop branch Related commits: 1. 1db38b0
2 parents 54d065a + 0f3e34d commit c268006

File tree

76 files changed

+334
-306
lines changed

Some content is hidden

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

76 files changed

+334
-306
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public function execute()
4444
$this->_eventManager->dispatch('catalog_controller_category_delete', ['category' => $category]);
4545
$this->_auth->getAuthStorage()->setDeletedPath($category->getPath());
4646
$this->categoryRepository->delete($category);
47-
$this->messageManager->addSuccess(__('You deleted the category.'));
47+
$this->messageManager->addSuccessMessage(__('You deleted the category.'));
4848
} catch (\Magento\Framework\Exception\LocalizedException $e) {
49-
$this->messageManager->addError($e->getMessage());
49+
$this->messageManager->addErrorMessage($e->getMessage());
5050
return $resultRedirect->setPath('catalog/*/edit', ['_current' => true]);
5151
} catch (\Exception $e) {
52-
$this->messageManager->addError(__('Something went wrong while trying to delete the category.'));
52+
$this->messageManager->addErrorMessage(__('Something went wrong while trying to delete the category.'));
5353
return $resultRedirect->setPath('catalog/*/edit', ['_current' => true]);
5454
}
5555
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function _validateProducts()
5454
}
5555

5656
if ($error) {
57-
$this->messageManager->addError($error);
57+
$this->messageManager->addErrorMessage($error);
5858
}
5959

6060
return !$error;

app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function execute()
192192
$this->_eventManager->dispatch('catalog_product_to_website_change', ['products' => $productIds]);
193193
}
194194

195-
$this->messageManager->addSuccess(
195+
$this->messageManager->addSuccessMessage(
196196
__('A total of %1 record(s) were updated.', count($this->attributeHelper->getProductIds()))
197197
);
198198

@@ -205,9 +205,9 @@ public function execute()
205205
$this->_productPriceIndexerProcessor->reindexList($this->attributeHelper->getProductIds());
206206
}
207207
} catch (\Magento\Framework\Exception\LocalizedException $e) {
208-
$this->messageManager->addError($e->getMessage());
208+
$this->messageManager->addErrorMessage($e->getMessage());
209209
} catch (\Exception $e) {
210-
$this->messageManager->addException(
210+
$this->messageManager->addExceptionMessage(
211211
$e,
212212
__('Something went wrong while updating the product(s) attributes.')
213213
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function execute()
6868
$response->setError(true);
6969
$response->setMessage($e->getMessage());
7070
} catch (\Exception $e) {
71-
$this->messageManager->addException(
71+
$this->messageManager->addExceptionMessage(
7272
$e,
7373
__('Something went wrong while updating the product(s) attributes.')
7474
);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ public function execute()
2121
// entity type check
2222
$model->load($id);
2323
if ($model->getEntityTypeId() != $this->_entityTypeId) {
24-
$this->messageManager->addError(__('We can\'t delete the attribute.'));
24+
$this->messageManager->addErrorMessage(__('We can\'t delete the attribute.'));
2525
return $resultRedirect->setPath('catalog/*/');
2626
}
2727

2828
try {
2929
$model->delete();
30-
$this->messageManager->addSuccess(__('You deleted the product attribute.'));
30+
$this->messageManager->addSuccessMessage(__('You deleted the product attribute.'));
3131
return $resultRedirect->setPath('catalog/*/');
3232
} catch (\Exception $e) {
33-
$this->messageManager->addError($e->getMessage());
33+
$this->messageManager->addErrorMessage($e->getMessage());
3434
return $resultRedirect->setPath(
3535
'catalog/*/edit',
3636
['attribute_id' => $this->getRequest()->getParam('attribute_id')]
3737
);
3838
}
3939
}
40-
$this->messageManager->addError(__('We can\'t find an attribute to delete.'));
40+
$this->messageManager->addErrorMessage(__('We can\'t find an attribute to delete.'));
4141
return $resultRedirect->setPath('catalog/*/');
4242
}
4343
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ public function execute()
2525
$model->load($id);
2626

2727
if (!$model->getId()) {
28-
$this->messageManager->addError(__('This attribute no longer exists.'));
28+
$this->messageManager->addErrorMessage(__('This attribute no longer exists.'));
2929
$resultRedirect = $this->resultRedirectFactory->create();
3030
return $resultRedirect->setPath('catalog/*/');
3131
}
3232

3333
// entity type check
3434
if ($model->getEntityTypeId() != $this->_entityTypeId) {
35-
$this->messageManager->addError(__('This attribute cannot be edited.'));
35+
$this->messageManager->addErrorMessage(__('This attribute cannot be edited.'));
3636
$resultRedirect = $this->resultRedirectFactory->create();
3737
return $resultRedirect->setPath('catalog/*/');
3838
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public function execute()
4343
$product = $this->productBuilder->build($this->getRequest());
4444
try {
4545
$newProduct = $this->productCopier->copy($product);
46-
$this->messageManager->addSuccess(__('You duplicated the product.'));
46+
$this->messageManager->addSuccessMessage(__('You duplicated the product.'));
4747
$resultRedirect->setPath('catalog/*/edit', ['_current' => true, 'id' => $newProduct->getId()]);
4848
} catch (\Exception $e) {
4949
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
50-
$this->messageManager->addError($e->getMessage());
50+
$this->messageManager->addErrorMessage($e->getMessage());
5151
$resultRedirect->setPath('catalog/*/edit', ['_current' => true]);
5252
}
5353
return $resultRedirect;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public function execute()
5252
if (($productId && !$product->getEntityId())) {
5353
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
5454
$resultRedirect = $this->resultRedirectFactory->create();
55-
$this->messageManager->addError(__('This product doesn\'t exist.'));
55+
$this->messageManager->addErrorMessage(__('This product doesn\'t exist.'));
5656
return $resultRedirect->setPath('catalog/*/');
5757
} elseif ($productId === 0) {
5858
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
5959
$resultRedirect = $this->resultRedirectFactory->create();
60-
$this->messageManager->addError(__('Invalid product id. Should be numeric value greater than 0'));
60+
$this->messageManager->addErrorMessage(__('Invalid product id. Should be numeric value greater than 0'));
6161
return $resultRedirect->setPath('catalog/*/');
6262
}
6363

app/code/Magento/Catalog/Controller/Adminhtml/Product/Group/Save.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public function execute()
2929
);
3030

3131
if ($model->itemExists()) {
32-
$this->messageManager->addError(__('A group with the same name already exists.'));
32+
$this->messageManager->addErrorMessage(__('A group with the same name already exists.'));
3333
} else {
3434
try {
3535
$model->save();
3636
} catch (\Exception $e) {
37-
$this->messageManager->addError(__('Something went wrong while saving this group.'));
37+
$this->messageManager->addErrorMessage(__('Something went wrong while saving this group.'));
3838
}
3939
}
4040
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Delete.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public function execute()
3636
$resultRedirect = $this->resultRedirectFactory->create();
3737
try {
3838
$this->attributeSetRepository->deleteById($setId);
39-
$this->messageManager->addSuccess(__('The attribute set has been removed.'));
39+
$this->messageManager->addSuccessMessage(__('The attribute set has been removed.'));
4040
$resultRedirect->setPath('catalog/*/');
4141
} catch (\Exception $e) {
42-
$this->messageManager->addError(__('We can\'t delete this set right now.'));
42+
$this->messageManager->addErrorMessage(__('We can\'t delete this set right now.'));
4343
$resultRedirect->setUrl($this->_redirect->getRedirectUrl($this->getUrl('*')));
4444
}
4545
return $resultRedirect;

app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ public function execute()
127127
$model->initFromSkeleton($this->getRequest()->getParam('skeleton_set'));
128128
}
129129
$model->save();
130-
$this->messageManager->addSuccess(__('You saved the attribute set.'));
130+
$this->messageManager->addSuccessMessage(__('You saved the attribute set.'));
131131
} catch (\Magento\Framework\Exception\AlreadyExistsException $e) {
132132
$this->messageManager->addErrorMessage($e->getMessage());
133133
$hasError = true;
134134
} catch (\Magento\Framework\Exception\LocalizedException $e) {
135-
$this->messageManager->addError($e->getMessage());
135+
$this->messageManager->addErrorMessage($e->getMessage());
136136
$hasError = true;
137137
} catch (\Exception $e) {
138-
$this->messageManager->addException($e, __('Something went wrong while saving the attribute set.'));
138+
$this->messageManager->addExceptionMessage($e, __('Something went wrong while saving the attribute set.'));
139139
$hasError = true;
140140
}
141141

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function execute()
137137
$response->setError(true);
138138
$response->setMessages([$e->getMessage()]);
139139
} catch (\Exception $e) {
140-
$this->messageManager->addError($e->getMessage());
140+
$this->messageManager->addErrorMessage($e->getMessage());
141141
$layout = $this->layoutFactory->create();
142142
$layout->initMessages();
143143
$response->setError(true);

app/code/Magento/Catalog/Controller/Product/Compare/Clear.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public function execute()
3030

3131
try {
3232
$items->clear();
33-
$this->messageManager->addSuccess(__('You cleared the comparison list.'));
33+
$this->messageManager->addSuccessMessage(__('You cleared the comparison list.'));
3434
$this->_objectManager->get(\Magento\Catalog\Helper\Product\Compare::class)->calculate();
3535
} catch (\Magento\Framework\Exception\LocalizedException $e) {
36-
$this->messageManager->addError($e->getMessage());
36+
$this->messageManager->addErrorMessage($e->getMessage());
3737
} catch (\Exception $e) {
38-
$this->messageManager->addException($e, __('Something went wrong clearing the comparison list.'));
38+
$this->messageManager->addExceptionMessage($e, __('Something went wrong clearing the comparison list.'));
3939
}
4040

4141
/** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */

app/code/Magento/Catalog/Controller/Product/Compare/Remove.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function execute()
4444
$item->delete();
4545
$productName = $this->_objectManager->get(\Magento\Framework\Escaper::class)
4646
->escapeHtml($product->getName());
47-
$this->messageManager->addSuccess(
47+
$this->messageManager->addSuccessMessage(
4848
__('You removed product %1 from the comparison list.', $productName)
4949
);
5050
$this->_eventManager->dispatch(

app/code/Magento/Catalog/Controller/Product/View.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,16 @@ public function execute()
7878

7979
if ($this->getRequest()->isPost() && $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED)) {
8080
$product = $this->_initProduct();
81+
8182
if (!$product) {
8283
return $this->noProductRedirect();
8384
}
85+
8486
if ($specifyOptions) {
8587
$notice = $product->getTypeInstance()->getSpecifyOptionMessage();
86-
$this->messageManager->addNotice($notice);
88+
$this->messageManager->addNoticeMessage($notice);
8789
}
90+
8891
if ($this->getRequest()->isAjax()) {
8992
$this->getResponse()->representJson(
9093
$this->_objectManager->get(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([

app/code/Magento/Catalog/Model/Indexer/Category/Product/TableMaintainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function getMainTable(int $storeId)
139139
public function createTablesForStore(int $storeId)
140140
{
141141
$mainTableName = $this->getMainTable($storeId);
142-
//Create index table for store based on on main replica table
142+
//Create index table for store based on main replica table
143143
//Using main replica table is necessary for backward capability and TableResolver plugin work
144144
$this->createTable(
145145
$this->getTable(AbstractAction::MAIN_INDEX_TABLE . $this->additionalTableSuffix),

app/code/Magento/Catalog/Model/Layer/Filter/AbstractFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ protected function _createItem($label, $value, $count = 0)
241241
}
242242

243243
/**
244-
* Get all product ids from from collection with applied filters
244+
* Get all product ids from collection with applied filters
245245
*
246246
* @return array
247247
*/

app/code/Magento/Catalog/Model/ResourceModel/Product/Option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ protected function _saveValueTitles(\Magento\Framework\Model\AbstractModel $obje
307307
}
308308

309309
/**
310-
* Get first col from from first row for option table
310+
* Get first col from first row for option table
311311
*
312312
* @param string $tableName
313313
* @param int $optionId

app/code/Magento/Catalog/Model/ResourceModel/Product/Option/Value.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ protected function _saveValueTitles(AbstractModel $object)
300300
}
301301

302302
/**
303-
* Get first col from from first row for option table
303+
* Get first col from first row for option table
304304
*
305305
* @param string $tableName
306306
* @param int $optionId

app/code/Magento/Catalog/view/adminhtml/web/js/product/weight-handler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ define([
6767
},
6868

6969
/**
70-
* Has weight swither
70+
* Has weight switcher
7171
* @returns {*}
7272
*/
73-
hasWeightSwither: function () {
73+
hasWeightSwitcher: function () {
7474
return this.$weightSwitcher().is(':visible');
7575
},
7676

@@ -107,7 +107,7 @@ define([
107107
'Magento_Catalog/js/product/weight-handler': function () {
108108
this.bindAll();
109109

110-
if (this.hasWeightSwither()) {
110+
if (this.hasWeightSwitcher()) {
111111
this.switchWeight();
112112
}
113113
},

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<waitForPageLoad stepKey="waitForPriceRulePage"/>
1919
<click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
2020

21-
<!-- Fill the form according the the attributes of the entity -->
21+
<!-- Fill the form according the attributes of the entity -->
2222
<fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
2323
<fillField stepKey="fillDescription" selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}"/>
2424
<selectOption stepKey="selectSite" selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}"/>

app/code/Magento/Cms/Controller/Adminhtml/Block/Delete.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ public function execute()
2626
$model->load($id);
2727
$model->delete();
2828
// display success message
29-
$this->messageManager->addSuccess(__('You deleted the block.'));
29+
$this->messageManager->addSuccessMessage(__('You deleted the block.'));
3030
// go to grid
3131
return $resultRedirect->setPath('*/*/');
3232
} catch (\Exception $e) {
3333
// display error message
34-
$this->messageManager->addError($e->getMessage());
34+
$this->messageManager->addErrorMessage($e->getMessage());
3535
// go back to edit form
3636
return $resultRedirect->setPath('*/*/edit', ['block_id' => $id]);
3737
}
3838
}
3939
// display error message
40-
$this->messageManager->addError(__('We can\'t find a block to delete.'));
40+
$this->messageManager->addErrorMessage(__('We can\'t find a block to delete.'));
4141
// go to grid
4242
return $resultRedirect->setPath('*/*/');
4343
}

app/code/Magento/Cms/Controller/Adminhtml/Block/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function execute()
4242
if ($id) {
4343
$model->load($id);
4444
if (!$model->getId()) {
45-
$this->messageManager->addError(__('This block no longer exists.'));
45+
$this->messageManager->addErrorMessage(__('This block no longer exists.'));
4646
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
4747
$resultRedirect = $this->resultRedirectFactory->create();
4848
return $resultRedirect->setPath('*/*/');

app/code/Magento/Cms/Controller/Adminhtml/Block/InlineEdit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function __construct(
4646

4747
/**
4848
* @return \Magento\Framework\Controller\ResultInterface
49+
* @throws \Magento\Framework\Exception\LocalizedException
4950
*/
5051
public function execute()
5152
{

app/code/Magento/Cms/Controller/Adminhtml/Block/MassDelete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function execute()
6060
$block->delete();
6161
}
6262

63-
$this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', $collectionSize));
63+
$this->messageManager->addSuccessMessage(__('A total of %1 record(s) have been deleted.', $collectionSize));
6464

6565
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
6666
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);

app/code/Magento/Cms/Controller/Adminhtml/Page/Delete.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,42 @@ public function execute()
2626
$id = $this->getRequest()->getParam('page_id');
2727
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
2828
$resultRedirect = $this->resultRedirectFactory->create();
29+
2930
if ($id) {
3031
$title = "";
3132
try {
3233
// init model and delete
3334
$model = $this->_objectManager->create(\Magento\Cms\Model\Page::class);
3435
$model->load($id);
36+
3537
$title = $model->getTitle();
3638
$model->delete();
39+
3740
// display success message
38-
$this->messageManager->addSuccess(__('The page has been deleted.'));
41+
$this->messageManager->addSuccessMessage(__('The page has been deleted.'));
42+
3943
// go to grid
40-
$this->_eventManager->dispatch(
41-
'adminhtml_cmspage_on_delete',
42-
['title' => $title, 'status' => 'success']
43-
);
44+
$this->_eventManager->dispatch('adminhtml_cmspage_on_delete', [
45+
'title' => $title,
46+
'status' => 'success'
47+
]);
48+
4449
return $resultRedirect->setPath('*/*/');
4550
} catch (\Exception $e) {
4651
$this->_eventManager->dispatch(
4752
'adminhtml_cmspage_on_delete',
4853
['title' => $title, 'status' => 'fail']
4954
);
5055
// display error message
51-
$this->messageManager->addError($e->getMessage());
56+
$this->messageManager->addErrorMessage($e->getMessage());
5257
// go back to edit form
5358
return $resultRedirect->setPath('*/*/edit', ['page_id' => $id]);
5459
}
5560
}
61+
5662
// display error message
57-
$this->messageManager->addError(__('We can\'t find a page to delete.'));
63+
$this->messageManager->addErrorMessage(__('We can\'t find a page to delete.'));
64+
5865
// go to grid
5966
return $resultRedirect->setPath('*/*/');
6067
}

0 commit comments

Comments
 (0)