diff --git a/code/extensions/SiteTreeChangeRecordable.php b/code/extensions/SiteTreeChangeRecordable.php index 50a48aa..ce98009 100644 --- a/code/extensions/SiteTreeChangeRecordable.php +++ b/code/extensions/SiteTreeChangeRecordable.php @@ -19,7 +19,12 @@ public function onAfterUnpublish() { public function updateCMSFields(FieldList $fields) { if (Permission::check('CMS_ACCESS_DataChangeAdmin')) { //Get all data changes relating to this page filter them by publish/unpublish - $dataChanges = DataChangeRecord::get()->filter('ClassID', $this->owner->ID)->exclude('ChangeType', 'Change'); + $dataChanges = DataChangeRecord::get()->filter(array( + 'ClassID' => $this->owner->ID, + 'ClassType' => $this->owner->ClassName + )) + ->exclude('ChangeType', 'Change'); + //create a gridfield out of them $gridFieldConfig = GridFieldConfig_RecordViewer::create(); $publishedGrid = new GridField('PublishStates', 'Published States', $dataChanges, $gridFieldConfig);