Skip to content

Commit 717710f

Browse files
committed
AC-1981: Widget parameters validation
* Added fix for widget parameters
1 parent f222be2 commit 717710f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/code/Magento/Widget/Model/Widget/Instance.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ private function getWidgetTemplatesFromConfig(
628628
* @return string
629629
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
630630
* @SuppressWarnings(PHPMD.NPathComplexity)
631+
* @throws LocalizedException
631632
*/
632633
public function generateLayoutUpdateXml($container, $templatePath = '')
633634
{
@@ -643,6 +644,10 @@ public function generateLayoutUpdateXml($container, $templatePath = '')
643644
if (!$this->getId() && !$this->isCompleteToCreate() || $templatePath && !is_readable($templateFilename)) {
644645
return '';
645646
}
647+
try {
648+
$this->validateWidgetParameters($container);
649+
} catch (LocalizedException $e) {
650+
}
646651
$parameters = $this->getWidgetParameters();
647652
$xml = '<body><referenceContainer name="' . $container . '">';
648653
$template = '';

0 commit comments

Comments
 (0)