Permalink
Browse files

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 #98 (comment)
  • Loading branch information...
1 parent 02fb7b6 commit 17195d4e868518d773be086616e113dc70709b52 @chillu chillu committed Feb 27, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −1 code/controller/TranslatableCMSMainExtension.php
  2. +2 −2 code/model/Translatable.php
  3. +2 −2 composer.json
@@ -211,7 +211,7 @@ function MultipleLanguages() {
* @return boolean
*/
function IsTranslatableEnabled() {
- return SiteTree::has_extension('Translatable');
+ return Object::has_extension('SiteTree', 'Translatable');
}
}
@@ -495,7 +495,7 @@ static function disable() {
*/
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 @@ function MetaTags(&$tags) {
}
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();
View
@@ -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":
{

0 comments on commit 17195d4

Please sign in to comment.