Hi Guys
I get this error (growl) when trying to open a page with this widget running (SS3.0.2)
Notice at line 168 of /nfs/c03/h01/mnt/81833/domains/youthguarantee.net.nz/html/framework/dev/Deprecation.php
Does anyone know how to fix this? My guess is theres something wrong in the php file:
<?php
/**
* Widget to display a single Page Content
* @package widgets.singlecontent
* @author Rui Godinho
*/
class SingleContentWidget extends Widget {
static $title = '';
static $cmsTitle = 'Single Content';
static $description = 'Adds content from a child page to the widget sidebar.';
static $db = array(
'WidgetTitle' => 'Varchar(255)',
'SinglePage'=>'Varchar(255)'
);
static $defaults = array(
'SinglePage'=>'home'
);
function Title() {
return $this->WidgetTitle ? $this->WidgetTitle : self::$title;
}
function getCMSFields() {
// TODO: Usar TreeDropdownField when bug fixed
return new FieldSet(
new TextField('WidgetTitle', _t('TITLE','Title (optional)')),
new TextField('SinglePage', _t('SINGLEPAGE', 'The URL segment of the page to display.'))
);
}
/**
* Return a Single Content Page
* @return DataObject
*/
function SingleContent() {
$page = DataObject::get_one('SiteTree', "URLSegment = '". Convert::raw2sql($this->SinglePage) . "'");
if(!$page) {
return false;
}
else {
return $page;
}
}
}
thanks all.
/w