BUGFIX: Updated DataObjectSet::map() to use empty string, rather than 0, as the empty value

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75585 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-04-29 01:01:09 +00:00
parent 54a5dc543f
commit bc7c8330f5
2 changed files with 2 additions and 2 deletions

View File

@ -626,7 +626,7 @@ class DataObjectSet extends ViewableData implements IteratorAggregate {
}
}
if($emptyString) $map = array('0' => "$emptyString") + $map;
if($emptyString) $map = array('' => "$emptyString") + $map;
if($sort) asort($map);
return $map;

View File

@ -51,7 +51,7 @@ class DataObjectSetTest extends SapphireTest {
$map = $comments->map('ID', 'Title', '(Select one)');
$expectedMap = array(
0 => '(Select one)',
'' => '(Select one)',
1 => 'Joe',
2 => 'Jane',
3 => 'Bob',