Skip to content

Commit 5065063

Browse files
authored
ENGCOM-7523: Added The return of Post Value when an Integration Exception is thrown while Save Action #26660
2 parents 0456811 + 7cabedf commit 5065063

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function execute()
7474
$this->_redirectOnSaveError();
7575
} catch (IntegrationException $e) {
7676
$this->messageManager->addError($this->escaper->escapeHtml($e->getMessage()));
77-
$this->_getSession()->setIntegrationData($integrationData);
77+
$this->_getSession()->setIntegrationData($this->getRequest()->getPostValue());
7878
$this->_redirectOnSaveError();
7979
} catch (\Magento\Framework\Exception\LocalizedException $e) {
8080
$this->messageManager->addError($this->escaper->escapeHtml($e->getMessage()));
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertAdminIntegrationNameInFormActionGroup">
11+
<arguments>
12+
<argument name="name" type="string"/>
13+
</arguments>
14+
<seeInField userInput="{{name}}" selector="{{AdminNewIntegrationSection.name}}" stepKey="checkEnteredValueIsPreserved"/>
15+
</actionGroup>
16+
</actionGroups>

app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,8 @@
5454
<argument name="message" value="The integration with name &quot;{{defaultIntegrationData.name}}&quot; exists."/>
5555
<argument value="error" name="messageType"/>
5656
</actionGroup>
57+
<actionGroup ref="AssertAdminIntegrationNameInFormActionGroup" stepKey="checkEnteredValueIsPreserved">
58+
<argument name="name" value="{{defaultIntegrationData.name}}"/>
59+
</actionGroup>
5760
</test>
5861
</tests>

0 commit comments

Comments
 (0)