Skip to content

Commit

Permalink
Fix(PublishedState) filter Published State tab by ClassName and ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen McMahon authored and stephenmcm committed Nov 7, 2018
1 parent 95cddd0 commit 060dfa1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/extensions/SiteTreeChangeRecordable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 060dfa1

Please sign in to comment.