Browse files

BUGFIX: avoid error of pass an null to TableListField::setCustomSourc…

…eItems()
  • Loading branch information...
1 parent a0bdf65 commit 38c70e0c0bdba261e02a8720a3c064fd9966d233 Normann Lou committed Feb 22, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 code/TranslatableModelAdmin.php
View
5 code/TranslatableModelAdmin.php
@@ -147,7 +147,10 @@ function EditForm() {
$this->currentRecord->class
);
$table->setPermissions(array('show'));
- $table->setCustomSourceItems($this->currentRecord->getTranslations());
+ if(!$sourceItems = $this->currentRecord->getTranslations()){
+ $sourceItems = new DataObjectSet();
+ }
+ $table->setCustomSourceItems($sourceItems);
$action->includeDefaultJS = false;
if($form->Fields()->hasTabSet()) {
$form->Fields()->findOrMakeTab(

0 comments on commit 38c70e0

Please sign in to comment.