Skip to content

Commit 74325ef

Browse files
minor refactor
1 parent a2346f4 commit 74325ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,14 @@ public function getWidgetDeclaration($type, $params = [], $asIs = true)
310310
{
311311
$widget = $this->getConfigAsObject($type);
312312

313+
$params = array_filter($params, function ($value) {
314+
return $value !== null;
315+
});
316+
313317
$directiveParams = '';
314318
foreach ($params as $name => $value) {
315319
// Retrieve default option value if pre-configured
316-
$directiveParams .= $value === null ? '' : $this->getDirectiveParam($widget, $name, $value);
320+
$directiveParams .= $this->getDirectiveParam($widget, $name, $value);
317321
}
318322

319323
$directive = sprintf('{{widget type="%s"%s%s}}', $type, $directiveParams, $this->getWidgetPageVarName($params));

0 commit comments

Comments
 (0)