Skip to content

Commit 05f9df7

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #17557: Replacing deprecated methods for Magento_Security module. (by @tiagosampaio) - #17548: Fixed typo in module AdminNotification (by @arnoudhgz) - #17549: Fixed typos in module CatalogRule (by @arnoudhgz) - #17550: Fixed typo 'Infomation' (by @arnoudhgz) - #17528: [Forwardport] AD-HOC feat (Profiler): Allow supplying complex profiler configuration (by @jignesh-baldha) - #17519: Added translation comment tags (by @yogeshks) - #15542: Add Currency Converter API connecting feature (by @HirokazuNishi) - #17495: [Forwardport] Magento 2.2.5: Year-to-date dropdown in Stores>Configuration>General>Reports>Dashboard #17289 (by @ronak2ram) Fixed GitHub Issues: - #15541: Cannot retrieve currency rates for TWD (reported by @HirokazuNishi) has been fixed in #15542 by @HirokazuNishi in 2.3-develop branch Related commits: 1. 5e66404 2. d682ead - #17289: Magento 2.2.5: Year-to-date dropdown in Stores>Configuration>General>Reports>Dashboard (reported by @joshuaflood) has been fixed in #17495 by @ronak2ram in 2.3-develop branch Related commits: 1. cea62ec 2. 1c70659
2 parents 8c1bd4c + 96021c7 commit 05f9df7

File tree

42 files changed

+274
-119
lines changed

Some content is hidden

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

42 files changed

+274
-119
lines changed

app/bootstrap.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,16 @@
5454
&& isset($_SERVER['HTTP_ACCEPT'])
5555
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
5656
) {
57-
\Magento\Framework\Profiler::applyConfig(
58-
(isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])) ? $_SERVER['MAGE_PROFILER'] : trim(file_get_contents(BP . '/var/profiler.flag')),
57+
$profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
58+
? $_SERVER['MAGE_PROFILER']
59+
: trim(file_get_contents(BP . '/var/profiler.flag'));
60+
61+
if ($profilerConfig) {
62+
$profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
63+
}
64+
65+
Magento\Framework\Profiler::applyConfig(
66+
$profilerConfig,
5967
BP,
6068
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
6169
);

app/code/Magento/AdminNotification/Observer/PredispatchAdminActionControllerObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
}
3838

3939
/**
40-
* Predispath admin action controller
40+
* Predispatch admin action controller
4141
*
4242
* @param \Magento\Framework\Event\Observer $observer
4343
* @return void

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getTabTitle()
6666
}
6767

6868
/**
69-
* Returns status flag about this tab can be showen or not
69+
* Returns status flag about this tab can be shown or not
7070
*
7171
* @return bool
7272
* @codeCoverageIgnore

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function _getCpCollectionInstance()
139139
}
140140

141141
/**
142-
* Define Cooser Grid Columns and filters
142+
* Define Chooser Grid Columns and filters
143143
*
144144
* @return $this
145145
*/

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@
9393
<argument name="customerAddressVar"/>
9494
</arguments>
9595
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
96-
<see userInput="{{customerVar.firstname}}" selector="{{CheckoutPaymentSection.shipToInfomation}}" stepKey="assertShipToInformationFirstName"/>
97-
<see userInput="{{customerVar.lastname}}" selector="{{CheckoutPaymentSection.shipToInfomation}}" stepKey="assertShipToInformationLastName"/>
98-
<see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.shipToInfomation}}" stepKey="assertShipToInformationStreet"/>
99-
<see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.shipToInfomation}}" stepKey="assertShipToInformationCity"/>
100-
<see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.shipToInfomation}}" stepKey="assertShipToInformationState"/>
101-
<see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.shipToInfomation}}" stepKey="assertShipToInformationPostcode"/>
102-
<see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.shipToInfomation}}" stepKey="assertShipToInformationTelephone"/>
96+
<see userInput="{{customerVar.firstname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationFirstName"/>
97+
<see userInput="{{customerVar.lastname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationLastName"/>
98+
<see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationStreet"/>
99+
<see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationCity"/>
100+
<see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationState"/>
101+
<see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationPostcode"/>
102+
<see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationTelephone"/>
103103
</actionGroup>
104104

105105
<!-- Check shipping method in checkout -->
@@ -108,7 +108,7 @@
108108
<argument name="shippingMethod"/>
109109
</arguments>
110110
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
111-
<see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInfomation}}" stepKey="assertshippingMethodInfomation"/>
111+
<see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/>
112112
</actionGroup>
113113

114114
<!-- Checkout select Check/Money Order payment -->

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<element name="ProductItemByName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']" parameterized="true" />
3737
<element name="ProductOptionsByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true" />
3838
<element name="ProductOptionsActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true" />
39-
<element name="shipToInfomation" type="text" selector="//div[@class='ship-to']//div[@class='shipping-information-content']" />
40-
<element name="shippingMethodInfomation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
39+
<element name="shipToInformation" type="text" selector="//div[@class='ship-to']//div[@class='shipping-information-content']" />
40+
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
4141
<element name="paymentMethodTitle" type="text" selector=".payment-method-title span" />
4242
<element name="productOptionsByProductItemPrice" type="text" selector="//div[@class='product-item-inner']//div[@class='subtotal']//span[@class='price'][contains(.,'{{var1}}')]//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true"/>
4343
<element name="productOptionsActiveByProductItemPrice" type="text" selector="//div[@class='subtotal']//span[@class='price'][contains(.,'{{var1}}')]//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true"/>
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Directory\Model\Currency\Import;
9+
10+
class CurrencyConverterApi extends AbstractImport
11+
{
12+
/**
13+
* @var string
14+
*/
15+
const CURRENCY_CONVERTER_URL = 'http://free.currencyconverterapi.com/api/v3/convert?q={{CURRENCY_FROM}}_{{CURRENCY_TO}}&compact=ultra'; //@codingStandardsIgnoreLine
16+
17+
/**
18+
* Http Client Factory
19+
*
20+
* @var \Magento\Framework\HTTP\ZendClientFactory
21+
*/
22+
private $httpClientFactory;
23+
24+
/**
25+
* Core scope config
26+
*
27+
* @var \Magento\Framework\App\Config\ScopeConfigInterface
28+
*/
29+
private $scopeConfig;
30+
31+
/**
32+
* Initialize dependencies
33+
*
34+
* @param \Magento\Directory\Model\CurrencyFactory $currencyFactory
35+
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
36+
* @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory
37+
*/
38+
public function __construct(
39+
\Magento\Directory\Model\CurrencyFactory $currencyFactory,
40+
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
41+
\Magento\Framework\HTTP\ZendClientFactory $httpClientFactory
42+
) {
43+
parent::__construct($currencyFactory);
44+
$this->scopeConfig = $scopeConfig;
45+
$this->httpClientFactory = $httpClientFactory;
46+
}
47+
48+
/**
49+
* {@inheritdoc}
50+
*/
51+
public function fetchRates()
52+
{
53+
$data = [];
54+
$currencies = $this->_getCurrencyCodes();
55+
$defaultCurrencies = $this->_getDefaultCurrencyCodes();
56+
57+
foreach ($defaultCurrencies as $currencyFrom) {
58+
if (!isset($data[$currencyFrom])) {
59+
$data[$currencyFrom] = [];
60+
}
61+
$data = $this->convertBatch($data, $currencyFrom, $currencies);
62+
ksort($data[$currencyFrom]);
63+
}
64+
return $data;
65+
}
66+
67+
/**
68+
* Return currencies convert rates in batch mode
69+
*
70+
* @param array $data
71+
* @param string $currencyFrom
72+
* @param array $currenciesTo
73+
* @return array
74+
*/
75+
private function convertBatch($data, $currencyFrom, $currenciesTo)
76+
{
77+
foreach ($currenciesTo as $to) {
78+
set_time_limit(0);
79+
try {
80+
$url = str_replace('{{CURRENCY_FROM}}', $currencyFrom, self::CURRENCY_CONVERTER_URL);
81+
$url = str_replace('{{CURRENCY_TO}}', $to, $url);
82+
$response = $this->getServiceResponse($url);
83+
if ($currencyFrom == $to) {
84+
$data[$currencyFrom][$to] = $this->_numberFormat(1);
85+
} else {
86+
if (empty($response)) {
87+
$this->_messages[] = __('We can\'t retrieve a rate from %1 for %2.', $url, $to);
88+
$data[$currencyFrom][$to] = null;
89+
} else {
90+
$data[$currencyFrom][$to] = $this->_numberFormat(
91+
(double)$response[$currencyFrom . '_' . $to]
92+
);
93+
}
94+
}
95+
} finally {
96+
ini_restore('max_execution_time');
97+
}
98+
}
99+
100+
return $data;
101+
}
102+
103+
/**
104+
* Get Fixer.io service response
105+
*
106+
* @param string $url
107+
* @param int $retry
108+
* @return array
109+
*/
110+
private function getServiceResponse($url, $retry = 0)
111+
{
112+
/** @var \Magento\Framework\HTTP\ZendClient $httpClient */
113+
$httpClient = $this->httpClientFactory->create();
114+
$response = [];
115+
116+
try {
117+
$jsonResponse = $httpClient->setUri(
118+
$url
119+
)->setConfig(
120+
[
121+
'timeout' => $this->scopeConfig->getValue(
122+
'currency/currencyconverterapi/timeout',
123+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
124+
),
125+
]
126+
)->request(
127+
'GET'
128+
)->getBody();
129+
130+
$response = json_decode($jsonResponse, true);
131+
} catch (\Exception $e) {
132+
if ($retry == 0) {
133+
$response = $this->getServiceResponse($url, 1);
134+
}
135+
}
136+
return $response;
137+
}
138+
139+
/**
140+
* {@inheritdoc}
141+
*/
142+
protected function _convert($currencyFrom, $currencyTo)
143+
{
144+
return 1;
145+
}
146+
}

app/code/Magento/Directory/etc/adminhtml/system.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
<label>Connection Timeout in Seconds</label>
5353
</field>
5454
</group>
55+
<group id="currencyconverterapi" translate="label" sortOrder="45" showInDefault="1" showInWebsite="0" showInStore="0">
56+
<label>Currency Converter API</label>
57+
<field id="timeout" translate="label" type="text" sortOrder="0" showInDefault="1" showInWebsite="0" showInStore="0">
58+
<label>Connection Timeout in Seconds</label>
59+
</field>
60+
</group>
5561
<group id="import" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
5662
<label>Scheduled Import Settings</label>
5763
<field id="enabled" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">

app/code/Magento/Directory/etc/config.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<webservicex>
2828
<timeout>100</timeout>
2929
</webservicex>
30+
<currencyconverterapi>
31+
<timeout>100</timeout>
32+
</currencyconverterapi>
3033
<import>
3134
<enabled>0</enabled>
3235
<error_email />

app/code/Magento/Directory/etc/di.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<item name="label" xsi:type="string" translatable="true">Fixer.io</item>
2323
<item name="class" xsi:type="string">Magento\Directory\Model\Currency\Import\FixerIo</item>
2424
</item>
25+
<item name="currencyconverterapi" xsi:type="array">
26+
<item name="label" xsi:type="string" translatable="true">Currency Converter API</item>
27+
<item name="class" xsi:type="string">Magento\Directory\Model\Currency\Import\CurrencyConverterApi</item>
28+
</item>
2529
</argument>
2630
</arguments>
2731
</type>

app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@
7272
<see selector="{{CheckoutPaymentSection.billingAddress}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="seeBilllingPostcode" />
7373
<see selector="{{CheckoutPaymentSection.billingAddress}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="seeBilllingTelephone" />
7474
<!-- Check that "Ship To" block contains correct information -->
75-
<see selector="{{CheckoutPaymentSection.shipToInfomation}}" userInput="{{CustomerAddressSimple.firstName}}" stepKey="seeShipToFirstName" />
76-
<see selector="{{CheckoutPaymentSection.shipToInfomation}}" userInput="{{CustomerAddressSimple.lastName}}" stepKey="seeShipToLastName" />
77-
<see selector="{{CheckoutPaymentSection.shipToInfomation}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="seeShipToStreet" />
78-
<see selector="{{CheckoutPaymentSection.shipToInfomation}}" userInput="{{CustomerAddressSimple.city}}" stepKey="seeShipToCity" />
79-
<see selector="{{CheckoutPaymentSection.shipToInfomation}}" userInput="{{CustomerAddressSimple.state}}" stepKey="seeShipToState" />
80-
<see selector="{{CheckoutPaymentSection.shipToInfomation}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="seeShipToPostcode" />
81-
<see selector="{{CheckoutPaymentSection.shipToInfomation}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="seeShipToTelephone" />
75+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.firstName}}" stepKey="seeShipToFirstName" />
76+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.lastName}}" stepKey="seeShipToLastName" />
77+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="seeShipToStreet" />
78+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.city}}" stepKey="seeShipToCity" />
79+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.state}}" stepKey="seeShipToState" />
80+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="seeShipToPostcode" />
81+
<see selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="seeShipToTelephone" />
8282
</test>
8383
</tests>

app/code/Magento/Reports/Block/Adminhtml/Config/Form/Field/YtdStart.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ protected function _getElementHtml(AbstractElement $element)
2323
{
2424
$_months = [];
2525
for ($i = 1; $i <= 12; $i++) {
26-
$_months[$i] = $this->_localeDate->date(mktime(null, null, null, $i))->format('m');
26+
$_months[$i] = $this->_localeDate->date(mktime(null, null, null, $i, 1))->format('m');
2727
}
28-
2928
$_days = [];
3029
for ($i = 1; $i <= 31; $i++) {
3130
$_days[$i] = $i < 10 ? '0' . $i : $i;

app/code/Magento/Search/Controller/Adminhtml/Synonyms/Delete.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,18 @@ public function execute()
6060
/** @var \Magento\Search\Model\SynonymGroup $synGroupModel */
6161
$synGroupModel = $this->synGroupRepository->get($id);
6262
$this->synGroupRepository->delete($synGroupModel);
63-
$this->messageManager->addSuccess(__('The synonym group has been deleted.'));
63+
$this->messageManager->addSuccessMessage(__('The synonym group has been deleted.'));
6464
} catch (\Magento\Framework\Exception\LocalizedException $e) {
65-
$this->messageManager->addError($e->getMessage());
65+
$this->messageManager->addErrorMessage($e->getMessage());
6666
$this->logger->error($e);
6767
} catch (\Exception $e) {
68-
$this->messageManager->addError(__('An error was encountered while performing delete operation.'));
68+
$this->messageManager->addErrorMessage(
69+
__('An error was encountered while performing delete operation.')
70+
);
6971
$this->logger->error($e);
7072
}
7173
} else {
72-
$this->messageManager->addError(__('We can\'t find a synonym group to delete.'));
74+
$this->messageManager->addErrorMessage(__('We can\'t find a synonym group to delete.'));
7375
}
7476

7577
return $resultRedirect->setPath('*/*/');

app/code/Magento/Search/Controller/Adminhtml/Synonyms/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function execute()
6565

6666
// 2. Initial checking
6767
if ($groupId && (!$synGroup->getGroupId())) {
68-
$this->messageManager->addError(__('This synonyms group no longer exists.'));
68+
$this->messageManager->addErrorMessage(__('This synonyms group no longer exists.'));
6969
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
7070
$resultRedirect = $this->resultRedirectFactory->create();
7171
return $resultRedirect->setPath('*/*/');

app/code/Magento/Search/Controller/Adminhtml/Synonyms/MassDelete.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ public function execute()
7272
$this->synGroupRepository->delete($synonymGroup);
7373
$deletedItems++;
7474
} catch (\Exception $e) {
75-
$this->messageManager->addError($e->getMessage());
75+
$this->messageManager->addErrorMessage($e->getMessage());
7676
}
7777
}
7878
if ($deletedItems != 0) {
7979
if ($collectionSize != $deletedItems) {
80-
$this->messageManager->addError(
80+
$this->messageManager->addErrorMessage(
8181
__('Failed to delete %1 synonym group(s).', $collectionSize - $deletedItems)
8282
);
8383
}
8484

85-
$this->messageManager->addSuccess(
85+
$this->messageManager->addSuccessMessage(
8686
__('A total of %1 synonym group(s) have been deleted.', $deletedItems)
8787
);
8888
}

app/code/Magento/Search/Controller/Adminhtml/Synonyms/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function execute()
5959
$synGroup = $this->synGroupRepository->get($synGroupId);
6060

6161
if (!$synGroup->getGroupId() && $synGroupId) {
62-
$this->messageManager->addError(__('This synonym group no longer exists.'));
62+
$this->messageManager->addErrorMessage(__('This synonym group no longer exists.'));
6363
return $resultRedirect->setPath('*/*/');
6464
}
6565

app/code/Magento/Search/Controller/Adminhtml/Term/Delete.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ public function execute()
2323
$model = $this->_objectManager->create(\Magento\Search\Model\Query::class);
2424
$model->setId($id);
2525
$model->delete();
26-
$this->messageManager->addSuccess(__('You deleted the search.'));
26+
$this->messageManager->addSuccessMessage(__('You deleted the search.'));
2727
$resultRedirect->setPath('search/*/');
2828
return $resultRedirect;
2929
} catch (\Exception $e) {
30-
$this->messageManager->addError($e->getMessage());
30+
$this->messageManager->addErrorMessage($e->getMessage());
3131
$resultRedirect->setPath('search/*/edit', ['id' => $this->getRequest()->getParam('id')]);
3232
return $resultRedirect;
3333
}
3434
}
35-
$this->messageManager->addError(__('We can\'t find a search term to delete.'));
35+
$this->messageManager->addErrorMessage(__('We can\'t find a search term to delete.'));
3636
$resultRedirect->setPath('search/*/');
3737
return $resultRedirect;
3838
}

0 commit comments

Comments
 (0)