BUGFIX Type checking problem in LookupField->Field(), merged in from r62387

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62381 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-09-15 04:32:53 +00:00
parent e76c68eff4
commit b7a2e4c8f2

View File

@ -13,7 +13,8 @@ class LookupField extends DropdownField {
* Returns a readonly span containing the correct value.
*/
function Field() {
if(trim($this->value)) {
if(trim($this->value) || $this->value === '0') {
$this->value = trim($this->value);
if(is_array($this->source)) {
$mappedValue = isset($this->source[$this->value]) ? $this->source[$this->value] : null;