mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
#1685 - Undefined index message when on readonly page in CMS (after deleting a page)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44585 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c36eac4671
commit
6d065d58f3
@ -8,12 +8,16 @@ class LookupField extends DropdownField {
|
||||
function Field() {
|
||||
if(trim($this->value)) {
|
||||
$this->value = trim($this->value);
|
||||
if(is_array($this->source)) $mappedValue = $this->source[$this->value];
|
||||
else $mappedValue = $this->source->getItem($this->value);
|
||||
if(is_array($this->source)) {
|
||||
$mappedValue = isset($this->source[$this->value]) ? $this->source[$this->value] : null;
|
||||
} else {
|
||||
$mappedValue = $this->source->getItem($this->value);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($mappedValue))
|
||||
if(!isset($mappedValue)) {
|
||||
$mappedValue = "<i>(none)</i>";
|
||||
}
|
||||
|
||||
if($this->value) {
|
||||
$val = $this->dontEscape
|
||||
@ -39,4 +43,4 @@ class LookupField extends DropdownField {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user