mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
2a2b1db203
commit
461f9e2af0
@ -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
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user