Skip to content

Commit b2d1580

Browse files
committed
AC-10528:Fix for Order Invoice Comment
1 parent b0d7542 commit b2d1580

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddComment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function execute()
104104
if (empty($data['comment'])) {
105105
throw new LocalizedException(__('The comment is missing. Enter and try again.'));
106106
}
107-
$comment = $this->escaper->escapeHtmlAttr($data['comment']);
107+
$comment = $this->escaper->escapeHtml($data['comment']);
108108

109109
$invoice = $this->getInvoice();
110110
if (!$invoice) {

app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected function setUp(): void
191191
->disableOriginalConstructor()
192192
->getMockForAbstractClass();
193193

194-
$this->escaper = $this->createPartialMock(Escaper::class, ['escapeHtmlAttr']);
194+
$this->escaper = $this->createPartialMock(Escaper::class, ['escapeHtml']);
195195

196196
$this->controller = $objectManager->getObject(
197197
AddComment::class,
@@ -277,7 +277,7 @@ public function testExecute(): void
277277
->with($invoiceMock, false, $data['comment']);
278278

279279
$this->escaper->expects($this->any())
280-
->method('escapeHtmlAttr')
280+
->method('escapeHtml')
281281
->willReturn($data['comment']);
282282

283283
$resultRaw = $this->getMockBuilder(Raw::class)

dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testSendEmailOnAddInvoiceComment(): void
4343
$escaper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
4444
->get(\Magento\Framework\Escaper::class);
4545

46-
$this->assertStringContainsString($escaper->escapeHtmlAttr($comment), $html);
46+
$this->assertStringContainsString($escaper->escapeHtml($comment), $html);
4747

4848
$message = $this->transportBuilder->getSentMessage();
4949
$this->assertNotNull($message);

0 commit comments

Comments
 (0)