mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
54a5dc543f
commit
bc7c8330f5
@ -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;
|
||||
|
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user