Permalink
Browse files

BUGFIX Fixed ModelAdmin->getResultsTable() to only apply summary fiel…

…d 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
  • Loading branch information...
1 parent 172ad1e commit 102ba8b424d00ff1a43f1f993c8116a176ed3b71 @chillu chillu committed Dec 20, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 code/ModelAdmin.php
View
@@ -740,7 +740,12 @@ function getResultsTable($searchCriteria) {
$tf->setFieldListCsv($exportFields);
$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;
}

0 comments on commit 102ba8b

Please sign in to comment.