Skip to content

Commit

Permalink
Merge pull request #144 from dnadesign/master
Browse files Browse the repository at this point in the history
Check for subclasses of Versioned
  • Loading branch information
Aaron Carlino committed Sep 5, 2016
2 parents a7260e6 + 23429cf commit 37bdaa8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions code/extensions/BetterButtonDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,18 @@ protected function createButtonGroup($groupName) {
* @return boolean
*/
public function checkVersioned() {
return $this->owner->config()->better_buttons_versioned_enabled &&
$this->owner->hasExtension('Versioned') &&
count($this->owner->getVersionedStages()) > 1;
$isVersioned = false;

foreach($this->owner->getExtensionInstances() as $extension) {
if($extension instanceof Versioned) {
$isVersioned = true;
break;
}
}

return $isVersioned &&
$this->owner->config()->better_buttons_versioned_enabled &&
count($this->owner->getVersionedStages()) > 1;
}


Expand Down

0 comments on commit 37bdaa8

Please sign in to comment.