Skip to content

Commit

Permalink
Fix includeBlankOption with value 0 - issue 1022
Browse files Browse the repository at this point in the history
Fix includeBlankOption with value 0 - issue contao#1022

implement contao#1022 (comment) with cast option values to string if values int - see https://github.com/menatwork/contao-multicolumnwizard-bundle/issues/63
  • Loading branch information
zonky2 committed Sep 1, 2021
1 parent 3803b97 commit 98e6f9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/library/Contao/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ public static function optionSelected($strOption, $varValues)
return '';
}

return (\is_array($varValues) ? \in_array($strOption, $varValues) : $strOption == $varValues) ? ' selected' : '';
return \in_array((string) $strOption, array_map('strval', (array) $varValues), true) ? ' selected' : '';
}

/**
Expand Down

0 comments on commit 98e6f9d

Please sign in to comment.