From b622547206b69d46423c242b221a29eefcb40150 Mon Sep 17 00:00:00 2001 From: James Ayers Date: Mon, 20 Aug 2018 19:48:46 +1200 Subject: [PATCH] FIX: Ensure Version gridfield has correct field formatting and variables. --- code/model/DMSDocument.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/model/DMSDocument.php b/code/model/DMSDocument.php index bafe0d2..c199145 100644 --- a/code/model/DMSDocument.php +++ b/code/model/DMSDocument.php @@ -820,22 +820,26 @@ class DMSDocument extends DataObject implements DMSDocumentInterface new GridFieldDataColumns(), new GridFieldPaginator(30) ); + + $link = $this->owner->Link(); + $filenameWithoutID = $this->owner->FilenameWithoutID; + $versionsGridFieldConfig->getComponentByType('GridFieldDataColumns') ->setDisplayFields(Config::inst()->get('DMSDocument_versions', 'display_fields')) ->setFieldFormatting( array( - 'FilenameWithoutID' => '' - . '$FilenameWithoutID' + 'FilenameWithoutID' => "" + . "$filenameWithoutID" ) ); $versionsGrid = GridField::create( 'Versions', _t('DMSDocument.Versions', 'Versions'), - $this->getVersions(), + $this->owner->getVersions(), $versionsGridFieldConfig ); - $this->addActionPanelTask('find-versions', 'Versions'); + $this->owner->addActionPanelTask('find-versions', 'Versions'); } $embargoValue = 'None';