From 17195d4e868518d773be086616e113dc70709b52 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 27 Feb 2013 10:48:57 +0100 Subject: [PATCH] 3.0 compatibibility (Object::has_extension) SiteTree::has_extension() is only available in 3.1, split off 3.0 compat branch to avoid deprecation warnings. See https://github.com/silverstripe/silverstripe-translatable/issues/98#issuecomment-14020318 --- code/controller/TranslatableCMSMainExtension.php | 2 +- code/model/Translatable.php | 4 ++-- composer.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/controller/TranslatableCMSMainExtension.php b/code/controller/TranslatableCMSMainExtension.php index ba04454..251944a 100644 --- a/code/controller/TranslatableCMSMainExtension.php +++ b/code/controller/TranslatableCMSMainExtension.php @@ -211,7 +211,7 @@ class TranslatableCMSMainExtension extends Extension { * @return boolean */ function IsTranslatableEnabled() { - return SiteTree::has_extension('Translatable'); + return Object::has_extension('SiteTree', 'Translatable'); } } \ No newline at end of file diff --git a/code/model/Translatable.php b/code/model/Translatable.php index 13fff60..4ebb4ec 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -495,7 +495,7 @@ class Translatable extends DataExtension implements PermissionProvider { */ static function is_enabled() { if(class_exists('SiteTree')){ - return SiteTree::has_extension('Translatable'); + return Object::has_extension('SiteTree', 'Translatable'); }else{ return false; } @@ -1454,7 +1454,7 @@ class Translatable extends DataExtension implements PermissionProvider { } function providePermissions() { - if(!SiteTree::has_extension('Translatable') || !class_exists('SiteTree')) return false; + if(!Object::has_extension('SiteTree', 'Translatable') || !class_exists('SiteTree')) return false; $locales = self::get_allowed_locales(); diff --git a/composer.json b/composer.json index f61f00c..2020b14 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ "require": { "php": ">=5.3.2", - "silverstripe/framework": ">=3.0.1", - "silverstripe/cms": ">=3.0.1" + "silverstripe/framework": ">=3.0.1,<3.1", + "silverstripe/cms": ">=3.0.1,<3.1" }, "extra": {