Skip to content

Commit

Permalink
FIX Resolve correct ItemRequest record table name
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Jan 29, 2017
1 parent e54dd32 commit 1a38a70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extensions/GridFieldBetterButtonsItemRequest.php
Expand Up @@ -560,10 +560,10 @@ public function recordIsPublished()
return false;
}

$baseClass = DataObject::getSchema()->baseDataClass($this->owner);
$baseClass = DataObject::getSchema()->baseDataClass($this->owner->record);
$stageTable = DataObject::getSchema()->tableName($baseClass) . '_Live';

return (bool) DB::query("SELECT \"ID\" FROM \"{$table}_Live\" WHERE \"ID\" = {$this->owner->record->ID}")
return (bool) DB::query("SELECT \"ID\" FROM \"{$stageTable}\" WHERE \"ID\" = {$this->owner->record->ID}")
->value();
}

Expand Down

0 comments on commit 1a38a70

Please sign in to comment.