Skip to content

Commit 049165e

Browse files
committed
AC-1846: Fixed Comment issue
* Added fix to comment
1 parent 031fe7e commit 049165e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class AddComment extends \Magento\Sales\Controller\Adminhtml\Order implements Ht
2020
*
2121
* @see _isAllowed()
2222
*/
23-
const ADMIN_RESOURCE = 'Magento_Sales::comment';
23+
public const ADMIN_RESOURCE = 'Magento_Sales::comment';
2424

2525
/**
2626
* ACL resource needed to send comment email notification
2727
*/
28-
const ADMIN_SALES_EMAIL_RESOURCE = 'Magento_Sales::emails';
28+
public const ADMIN_SALES_EMAIL_RESOURCE = 'Magento_Sales::emails';
2929

3030
/**
3131
* Add order comment action
@@ -52,13 +52,12 @@ public function execute()
5252
$notify = false;
5353
}
5454

55-
$history = $order->addStatusHistoryComment($data['comment'], $data['status']);
55+
$comment = trim(strip_tags($data['comment']));
56+
$history = $order->addStatusHistoryComment($comment, $data['status']);
5657
$history->setIsVisibleOnFront($visible);
5758
$history->setIsCustomerNotified($notify);
5859
$history->save();
5960

60-
$comment = trim(strip_tags($data['comment']));
61-
6261
$order->save();
6362
/** @var OrderCommentSender $orderCommentSender */
6463
$orderCommentSender = $this->_objectManager

0 commit comments

Comments
 (0)