From 102ba8b424d00ff1a43f1f993c8116a176ed3b71 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 20 Dec 2010 00:00:48 +0000 Subject: [PATCH] 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 --- code/ModelAdmin.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/ModelAdmin.php b/code/ModelAdmin.php index a5a97d95..294fe884 100755 --- a/code/ModelAdmin.php +++ b/code/ModelAdmin.php @@ -740,7 +740,12 @@ class ModelAdmin_CollectionController extends Controller { $tf->setFieldListCsv($exportFields); $url = 'Link() . '/$ID/edit\">$value'; - $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; }