Skip to content

Commit

Permalink
Assign false to 0 when casting as string
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Nov 18, 2019
1 parent cb00087 commit 61b7108
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libraries/src/Form/Field/RadioField.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ protected function getLayoutData()
{
$data = parent::getLayoutData();

// Casting false as string returns an empty string so assign it 0
if (is_bool($this->value) && $this->value === false)
{
$this->value = '0';
}

$extraData = array(
'options' => $this->getOptions(),
'value' => (string) $this->value,
Expand Down

0 comments on commit 61b7108

Please sign in to comment.