3.2.x compat

This commit is contained in:
Ingo Schommer 2015-04-30 22:49:17 +12:00
parent 59e4ba50f2
commit f2f6b6e18c
4 changed files with 10 additions and 9 deletions

View File

@ -1,6 +1,6 @@
# Widgets Module
[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-widgets.png?branch=master)](http://travis-ci.org/silverstripe/silverstripe-widgets)
[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-widgets.png?branch=1.1)](http://travis-ci.org/silverstripe/silverstripe-widgets)
## Introduction
@ -11,7 +11,7 @@ the sidebar of your website. To check out a what a [Widget](http://silverstripe.
## Requirements
* SilverStripe 3.1
* SilverStripe 3.2
### Installation

View File

@ -31,7 +31,7 @@ class WidgetContentControllerExtension extends Extension {
// find WidgetArea relations
$widgetAreaRelations = array();
$hasOnes = $this->owner->data()->has_one();
$hasOnes = $this->owner->data()->hasOne();
if(!$hasOnes) {
return false;
@ -51,9 +51,9 @@ class WidgetContentControllerExtension extends Extension {
break;
}
$widget = $this->owner->data()->$widgetAreaRelation()->Widgets(
sprintf('"Widget"."ID" = %d', $SQL_id)
)->First();
$widget = $this->owner->data()->$widgetAreaRelation()->Widgets()
->filter('ID', $SQL_id)
->First();
}
if(!$widget) {

View File

@ -51,7 +51,8 @@ class WidgetArea extends DataObject {
* @return HasManyList
*/
public function ItemsToRender() {
return $this->getComponents('Widgets', "\"Widget\".\"Enabled\" = 1");
return $this->getComponents('Widgets')
->filter("Enabled", 1);
}
/**

View File

@ -10,8 +10,8 @@
}
],
"require": {
"silverstripe/framework": ">=3.1",
"silverstripe/cms": ">=3.1"
"silverstripe/framework": "~3.2",
"silverstripe/cms": "~3.2"
},
"require-dev": {
"phpunit/PHPUnit": "~3.7@stable"