Skip to content

Commit f20b05b

Browse files
author
Zach Nanninga
committed
ISSUE-27397 - Update widget validation controller to properly handle translation phrase result as an error message
1 parent 8d90d12 commit f20b05b

File tree

1 file changed

+3
-0
lines changed
  • app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ 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+
}
2225
if ($result !== true && is_string($result)) {
2326
$this->messageManager->addError($result);
2427
$this->_view->getLayout()->initMessages();

0 commit comments

Comments
 (0)