Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Radio buttons don't check if bound to subdocument #668

wants to merge 1 commit into from

3 participants


As in the object I noticed that if a radio button set is bound to a subdocument using a dot notation (e.g. it doesn't checks.

This happens because the $name variable passed is changed before the value check and so it always fails.


Thanks for the fix! We accept pull requests against the dev branch, and will merge it once it has an accompanying test case that proves the issue. You can refer to our contributor guide for more information:


Since this has been floating for a little while, I'd be happy to re-submit against the latest dev and write tests.

Any thoughts on where to place the tests? I figured I it would be best to just extend:


to account for dot-notation names. Thought I would check first.


@ericcholis That would be most appreciated, thanks. Extending those existing tests sounds fine.


All set, opened a new issue #815


Closing in favor of #815. Thanks @ericcholis.

@nateabele nateabele closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 template/helper/Form.php
5 template/helper/Form.php
@@ -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);
@@ -857,4 +858,4 @@ protected function _generators($method, $name, $options) {
Something went wrong with that request. Please try again.