mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
3.2.x compat
This commit is contained in:
parent
59e4ba50f2
commit
f2f6b6e18c
@ -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
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user