Skip to content

Commit

Permalink
Fixing Radio buttons not checking if bound to subdocument
Browse files Browse the repository at this point in the history
  • Loading branch information
giacmir committed Oct 24, 2012
1 parent 96bb832 commit 2a71086
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions template/helper/Form.php
Expand Up @@ -670,11 +670,12 @@ public function radio($name, array $options = array()) {
$defaults = array('value' => '1');
$options += $defaults;
$default = $options['value'];
$key = $name;

list($name, $options, $template) = $this->_defaults(__FUNCTION__, $name, $options);
list($scope, $options) = $this->_options($defaults, $options);

if (!isset($options['checked']) && ($bound = $this->binding($name)->data)) {
if (!isset($options['checked']) && ($bound = $this->binding($key)->data)) {
$options['checked'] = ($bound == $default);
}

Expand Down Expand Up @@ -857,4 +858,4 @@ protected function _generators($method, $name, $options) {
}
}

?>
?>

0 comments on commit 2a71086

Please sign in to comment.