BUGFIX Fixed ModelAdmin->getResultsTable() to only apply summary field formatting if at least one field exists, to avoid array_fill() errors

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@115184 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-12-20 00:00:48 +00:00
parent 172ad1e418
commit 102ba8b424

View File

@ -740,7 +740,12 @@ class ModelAdmin_CollectionController extends Controller {
$tf->setFieldListCsv($exportFields); $tf->setFieldListCsv($exportFields);
$url = '<a href=\"' . $this->Link() . '/$ID/edit\">$value</a>'; $url = '<a href=\"' . $this->Link() . '/$ID/edit\">$value</a>';
$tf->setFieldFormatting(array_combine(array_keys($summaryFields), array_fill(0,count($summaryFields), $url))); if(count($summaryFields)) {
$tf->setFieldFormatting(array_combine(
array_keys($summaryFields),
array_fill(0,count($summaryFields), $url)
));
}
return $tf; return $tf;
} }