Skip to content

Commit 1e4ef87

Browse files
author
Zach Nanninga
committed
ISSUE-27397 - Reformat phrase check (no functional change)
1 parent f20b05b commit 1e4ef87

File tree

1 file changed

+2
-5
lines changed
  • app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance

1 file changed

+2
-5
lines changed

app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Validate.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ public function execute()
1919
$response->setError(false);
2020
$widgetInstance = $this->_initWidgetInstance();
2121
$result = $widgetInstance->validate();
22-
if ($result instanceof \Magento\Framework\Phrase) {
23-
$result = (string) $result;
24-
}
25-
if ($result !== true && is_string($result)) {
26-
$this->messageManager->addError($result);
22+
if ($result !== true && (is_string($result) || $result instanceof \Magento\Framework\Phrase)) {
23+
$this->messageManager->addError((string) $result);
2724
$this->_view->getLayout()->initMessages();
2825
$response->setError(true);
2926
$response->setHtmlMessage($this->_view->getLayout()->getMessagesBlock()->getGroupedHtml());

0 commit comments

Comments
 (0)