elofgren: VAR FIX: Fix EditableRadioField? 'optionNumber' and 'optionData' undefined variable errors by initializing 'optionNumber' and using 'newOption' instead of 'optionData'. These errors were

encountered when adding a new 'newsletter subscription form' type page. 
(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41816 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-14 23:22:23 +00:00
parent 2a2b1db203
commit 461f9e2af0

View File

@ -142,6 +142,7 @@ class EditableRadioField extends EditableFormField {
$paramMap = $this->parsePrepopulateValue( $value );
// find options and add them
$optionNumber = 0;
foreach( $paramMap['Options'] as $newOption ) {
if( preg_match( '/([^:]+)[:](.*)/', $newOption, $match ) ) {
$newOptionValue = $match[1];
@ -153,7 +154,7 @@ class EditableRadioField extends EditableFormField {
'option' . (string)$optionNumber,
$newOptionTitle,
'new-' . (string)$optionNumber,
$optionData['Sort'],
$newOption['Sort'],
$optionNumber == 1,
false
);