Is this a bug with the form designer?

Permalink
Whenever I add a select box to my forms, it only shows the first item in the list. Im using RC2.

jizzle
 
jizzle replied on at Permalink Reply
jizzle
Sorry, it actually only shows the last item in the list.
andrew replied on at Permalink Reply
andrew
Yeah. I see that. We'll look at that.
jizzle replied on at Permalink Reply
jizzle
Thanks, if you find the fix prior to next release, would a temporary patch be possible?
jizzle replied on at Permalink Reply
jizzle
Ok, I found the answer to this problem... appears to be a small typo:

Starting on line #450 in /concrete/blocks/form/controller.php, the brackets were forgotten for the the loop. The original code is:

foreach($options as $option)
                  $checked=($_REQUEST['Question'.$msqID]==trim($option))?'selected':'';
                  $html.= '<option '.$checked.'>'.trim($option).'</option>';


but should be changed to:

foreach($options as $option)
               { // THIS WAS FORGOTTEN
                  $checked=($_REQUEST['Question'.$msqID]==trim($option))?'selected':'';
                  $html.= '<option '.$checked.'>'.trim($option).'</option>';
               } // THIS WAS FORGOTTEN