Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Charlie committed Aug 31, 2020
1 parent ae3d3df commit a2346f4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/code/Magento/Widget/Model/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function getWidgetDeclaration($type, $params = [], $asIs = true)
$directiveParams = '';
foreach ($params as $name => $value) {
// Retrieve default option value if pre-configured
$directiveParams .= $this->getDirectiveParam($widget, $name, $value);
$directiveParams .= $value === null ? '' : $this->getDirectiveParam($widget, $name, $value);
}

$directive = sprintf('{{widget type="%s"%s%s}}', $type, $directiveParams, $this->getWidgetPageVarName($params));
Expand Down Expand Up @@ -354,9 +354,7 @@ private function getDirectiveParam(DataObject $widget, string $name, $value): st
$value = $this->getPreparedValue($value);
}

return $value !== null
? sprintf(' %s="%s"', $name, $this->escaper->escapeHtmlAttr($value, false))
: '';
return sprintf(' %s="%s"', $name, $this->escaper->escapeHtmlAttr($value, false));
}

/**
Expand Down

0 comments on commit a2346f4

Please sign in to comment.