Skip to content

Commit

Permalink
Merge pull request #5 from steffen-maass/file-relation
Browse files Browse the repository at this point in the history
NEW: Replaced getComponent(...)-call with a method call
  • Loading branch information
colymba committed Jul 9, 2014
2 parents e0301ca + f1dbcd6 commit b94fa20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/GridFieldGalleryTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function getColumnsHandled($gridField)

function getColumnContent($gridField, $record, $columnName)
{
$previewObj = $record->getComponent($this->thumbnailField);
$previewObj = $record->{$this->thumbnailField}();
$imgFile = GRIDFIELD_GALLERY_THEME_PATH . '/img/icons/missing.png';

if ( $previewObj->ID )
Expand Down Expand Up @@ -113,7 +113,7 @@ function getFileTypeIcon ( $file )
function getColumnAttributes($gridField, $record, $columnName)
{
$class = 'galleryThumbnail';
$previewObj = $record->getComponent($this->thumbnailField);
$previewObj = $record->{$this->thumbnailField}();
if ( $previewObj )
{
if ( $previewObj instanceof Image ) $class .= ' image';
Expand Down

0 comments on commit b94fa20

Please sign in to comment.